Previous Topic

Next Topic

Book Contents

Book Index

Command Layout

The command window provides a graphic user interface for developing and executing R commands and scripts. The illustration below shows the organization using the horizontal layout.

RConsole1

Commands Area

The Commands area serves the following purposes:

  1. Interactive R command execution: R commands can be manually typed into the area and executed with the button. If multiple code lines were entered, execution can be restricted to a highlighted part by the button.
  2. Code generated by Scripts: Whenever a script is called, its R code is copied to the Commands area and then executed.
  3. Execution history: Whenever the Commands contents is executed, it is copied to a history buffer. If the Auto-clear box is checked, the Command area is cleared after command execution. However, using the keyboard keys Ctrl+up-arrow and Ctrl+down-arrow, prior execution code can be retrieved from the history for inspection/modification. For users interested in R it may be of interest to recall and review the code of in-built scripts.

Output Area

Connecting to the server localhost ... Connected.

Loading default settings ... Loaded.

R version 3.4.2 (2017-09-28) Windows

Loading input data 1/2 ... Loaded.

Loading input data 2/2 ... Loaded.

> summary(g1);
Length Class Mode
vt 16 data.frame list

> ls();
[1] "g1" "g2" "pm.getc" "pm.gete" "pm.getf"
[6] "pm.geti" "pm.getm" "pm.getp" "pm.getr" "pm.getslc"
[11] "pm.getv" "pm.getx" "pm.mutualc" "pm.mutualr" "pm.mutualrc"
[16] "pm.setc" "pm.setm" "pm.setp" "pm.setr" "pm.setslc"
[21] "pm.size" "pm.sortc" "pm.sortr" "pm.sortrc" "pm.trim"
[26] "zz"

Errors Area

Please check the contents of the Errors area, if the behavior of the R console is unexpected.

PMOD R Commands and Code Generator

PMOD has implemented a set of commands dedicated to the PMOD Command console. This commands list is accessible typing the pm. in the Command console. Their description is available upon selection from the pop-up menu as shown below:

RCommandPM

RCommandToolbarData

RCommandWindowDataSelection

Allows:

  • creating new data structures such as vector, array , matrix or list
  • creating images based on specified parameters or from pixel-dump files
  • converting a vector into list specifying a vector function
  • converting a data frame into an aggregated file
  • renaming a variable in teh workspace

RCommandToolbarMatrix

Basic operations on matrices.

RCommandToolbarMatrixSelection

RCommandToolbarStat

Allows applying predefined statistic operations to the variables available in the workspace.

RCommandToolbarStatLIst

RCommand_ToolbarWorkspace

Allows performing various quick operation like listing (ls()), removing(rm()) and accessing the summary (summary()) of the variables available in the workspace. The results are displayed in the Output console.

RConsole_Command_Workspace

RCommandToolbar_EditVariable

Allows editing a variable available in the workspace. Upon activation the list of variables available in the workspace is displayed. The data type is detected automatically. Two options are available: either Choose variable or Define expression.

RCommandToolbar_EditVar_Eg

The user can decide which Part of the selected variable has to be edited: Time or Value. The confirmation of the settings opens a dialog window which allows performing the editing.

REditVariable1

There are four ways to replace with the specified Value the content of the displayed table:

  • specifying the Rows and Columns in the dedicated text fields
  • using a Threshold definition based on one of the three criteria: >, <, =. All the pixels above, below or equal to the specified value will be replaced by the Value.
  • In range is similar to the Threshold except that two limits are defined in the from and to text fields
  • the Outliers will be considered all the observations that fall below Q1 - factor*(IQR) or above Q3 + factor*(IQR). The IQR is representing the interquartile range and is calculated as IQR=Q3-Q1. The Q1 and Q3 are respresenting the first and third quartile respectively. In a boxplot, the highest and lowest occurring value within this limit are drawn as bar of the whiskers, and the outliers as individual points.

Once the method is selected and all the parameters specified the Set to button allows setting the new Value in the table. Activate the Create new variable checkbox and specify a name in order to avoid overwritting the original variable. Close the dialog window with the OK button.

RCommandToolbarSCripts

Allows selecting and running general predefined R scripts. Detailed information of the scripts is available in the dedicated section in this documentation.

The predefined scripts are available for selection with the small arrow closed to the button. To add a R script to the predefined list, please copy the *.r file in the Pmod installation folder in C:\Pmod3.9\resources\extlibs\r

RCommandToolbarScriptsSelection

If any help section was included in the script this can be visualized activating the ? icon close to the scripts selection list.

RInterfaceClearWorkspace

Allows deleting a script from the scripts predefined list.

RCommandToolbarLayout

Allows switching between the two layout options: horizontal and vertical.

RCommandToolbarLayoutSelection

RComment

Allows commenting the command lines. First, the lines have to be selected and the icon activated.

RCommentEg

RUncomment

Allows uncommenting the selected command lines in the command console. First, the lines have to be selected and the icon activated.

RCommandToolbar_CopyButton

In the Commands console: allows copying commands console to the clipboard.

In the Output console: allows copying output content to clipboard.

In the Errors console: allows copying the errors messages to the clipboard.

R CommentDelete

In the Commands console: allows deleting the content of the command console.

In the Output console: allows clearing the output content .

In the Errors console: allows deleting the errors messages.