# Launching

## Configure Console

Before being able to use an R Console, it is necessary to configure one. The inconvenience of needing to specify configurations is very low compared to the many advantages R configurations offer: one can configure R Consoles for different versions of R (e.g. current release and devel release) or with different default startup-options.

To configure a console, navigate to Run > Run Configurations...

The user is invited to assign a name to the particular configuration and adjust the relevant settings in the tabs of the configuration window. The most important tabs are dealt with in detail in separate paragraphs below.

### Main

The Launch Type allows specifies how the connection to R will be managed. The default is the Java-based RJ console connection which is fully cross-platform (requires R package `rj`, see homepage). An older connection type Rterm is provided as well. Many features of StatET are only available for RJ.

##### R Options

The Working Directory specifies the initial working directory of your R session.

The Options field allows to specify R startup-options, such as `--no-environ`,`--no-init-file` etc.

### R Config

The R Config tab allows to specify which R environment to use.

An R environment is simply a given version of R linked to a certain path on your file system. One can either choose the default R environment that you set for the workbench or a specific environment (Selected Configuration). When one presses the 'Configure...' button, the R Environments preference page will show up.

If the R environment is not yet setup, the following steps create a new configuration:

1. 'Add...' opens the edit dialog for a new local R environment configuration.
2. The user will be asked to provide a name and to indicate the path to the `$R_HOME` for that given R (not `$R_HOME/bin` !!).
3. It is recommended to press Detect Default Properties/Settings to load the defaults for the other properties and settings.
4. Upon clicking 'OK' the configuration will be added to the list of R environments, so the user can make use of them when configuring the 'R Config' tab of an R Console launch configuration.

### Other Configuration Options

The console option 'Pin initial console automatically' will pin the initial console. This means that when one opens additional R consoles, these will be opened in separate Console Views.

## Launch Console

To launch a run configuration such as an R console, one can accede the Run menu and choose Run > Run Configurations... Among the many possible run configurations, you will find the R Console menu with a list of all currently R Console configurations.

You can either double-click on the R Console configuration of your choice or select the configuration and click on the Run button.

If during configuration of an R Console, you chose to display this particular run configuration in the favorites menu, the configuration will be listed.

#### Launching in Debug mode ()

If you want to debug R code using the integrated visual debugger, the console have to be started in the Debug mode. Instead of the 'Run' toolbar or menu items, choose the respective 'Debug' items. To open the launch configuration, select: Run > Debug Configurations... The configurations are shared with the configuration for the Run mode.

You can either double-click on the R Console configuration of your choice or select the configuration and click on the Debug button to launch the console with enabled support for the debugger.