Run R Scripts

R scripts can be executed like any other script (OML, Tcl, and Python) by pressing the Run button. Likewise, you can interrupt them by pressing the Stop button.

It is important to note how the R interpreter is accessed from Compose. When Compose starts, only the OML interpreter is loaded. The Python and R interpreters are only loaded “on demand”.

To access the R interpreter:
  1. Select File > New > R script OR File > Load and select an existing R script.
  2. By selecting an R script, the R interpreter (as defined by the R_HOME environment variable) is loaded and the R Command Window is displayed.
  3. Use the View menu to show or hide the R Command Window.
The following differences exist between the way Compose runs a script and the run in R:
  • The Run button in Compose works like “source” in R: it executes all commands, but silently.
  • Run Selection is available for all or part of the script.
  • To emulate the verbose run in the R environment, select all lines of the script and select Run Selection.