RKWard

From KDE UserBase Wiki
Revision as of 08:13, 21 July 2011 by Claus chr (talk | contribs) (Importing a new version from external source)
Other languages:


Oversigt

RKWard er et integreret udviklingsmiljø (IDE) for programmeringssproget R bygget på KDE's udviklingsplatform. R er et sprog, som er særligt rettet mod statistik og datamanipulation.

Hovedpunkter

  • Udviklingsmiljø med syntaksfremhævning, kodefærdiggørelse, objektbrowser og dataeditor
  • Direkte brugerflade for R
  • Grafiske værktøjer for tilgang til R's statistik- og graftegningsfunktioner
  • Integreret R-prompt til arbejde i læs-evaluér-print-løkke (REPL)
  • Håndtering af pakker til R
  • Indlæsning og gemning af R's statistiske arbejdstilstande
  • Udvidbar med ECMAScript-plugins


Arbejdstilstande

RKWard kan bruges på to forskellige måder: enten som et normalt IDE; det vil sige at skrive kode, som vil blive brugt i programmer eller scripts, via en interaktiv session, hvor kode evalueres umiddelbart (det er R-programmørers foretrukne arbejdsmåde) eller en blanding af disse.

Den interaktive fortolker

RKWard giver dig en integret R-prompt, som kan bruges i en såkaldt "læs-evaluér-print-løkke" (REPL).

Den interaktive prompt

Prompten er i alt væsentligt identisk med R's konsol-prompt med nogle ekstra muligheder. For eksempel understøtter den færdiggørelse af funktionsnavne og calltips (popup-bokse, som viser en funktions signatur) og også forskellige måder at kopiere og indsætte kode.

Denne måde virker lige som en normal R session: kommandoer indskrives, output og andre objekter skabes og resultater kan vises eller gemmes ved brug af R's egne funktioner.

Programming in RKward

The code editor

Programming in RKWard is done like in any other IDE: the code editor offers completion, syntax highlighting, and calltips. The code editor however offers additional functions that can be used in an interactive session. Specific commands can be issued to execute all the currently loaded code, or only the selected code: this is particularly useful when writing functions to be then prototyped in an interactive session.

Taking a look at R objects

Since working in R often involves loading "libraries" (add-on packages) and creating multiple objects, RKward offers an interface to inspect and show the objects loaded in memory by R.


The object browser


The object browser allows access to both R's global environment and the packages's own environment. Additional information are available either as tooltips or by double-clicking items, which will open a new tab in RKWard's interface showing information on the object in question.

Data manipulation

Along with code aids, RKward has a way to handle data directly from the program. In particular, one can view matrices and data frames (R's own definition of data tables) in the interface, or create new ones.

Existing data can be imported: RKWard supports text files (TSV/CSV) and also data from widely used statistics programs such as STATA or SPSS.


The TSV import dialog


The interface can show the column names, the types of the columns (numbers, strings, etc.) and the data itself, using a spreadsheet-like user interface.


The data browser


There is direct support for editing and data manipulaiton: for example, adding rows or columns, changing row headers, and also the data type of the columns themselves, acting like a simplified spreadsheet.

Interactive statistics and plotting

RKWard offers simplified front-ends to a number of R's statistical functions and to generate graphs for data. These can be accessed from the Analysis, Plots and Distributions menus.


One of the many analysis aids


For example, many type of plots can be executed through the functions in the aforementioned menus. Each function (as the example above shows) has its dedicated configuration dialog, where any compatible object from R's global namespace can be used. Also the dialogs offer shortcuts to specific plot or analysis options. Results are then output in HTML form in RKWard's main window, where they can be exported or saved.