# R Environments

An R environment is a given version of R and a collection of R libraries. R environments are used to launch R correctly and to identify a clear working environment for R related tasks. For example a help index is associated with an R environment.

There are several configuration types of R environments:

- User-defined Local: For common R installations on the local system.
  This is the default type and the usual choice for most users.
- User-defined Remote: For R installations on a remote system.
  This type can be used for remote console.
- Eclipse: For R installations provided by an Eclipse plug-in.
  This type cannot be created and edited by the user.

### Preferences

The R environments for your Eclipse workspace can be viewed and configured in the preferences: R > Run/Debug > R Environments

One can specify as many R environments as wanted as long as they have a unique name. Buttons 'Add..', 'Edit', etc. allow to define new environments or edit existing ones. Using the 'Default' button is possible to define a environment as default environment for the Eclipse workspace.

#### User-defined Local Configurations

For user-defined local configurations, the user will be asked to provide a name and to indicate the path to the R home directory for that given R. R home, also known as the environment variable `R_HOME`, is the root directory of the R installation, containing among others the sub-directories `bin`, `etc` and `library`. Some R installations supports different sub-architectures (e.g. 32-bit `i386` and 64-bit `x86_64`); you can change it in the drop down field 'Architecture'. If these settings are correct, the button 'Detect Default Properties/Settings' allows to load the defaults for the other properties and settings. Experienced user can also edit and adapt them manually, for instance to add additional R library locations.

#### User-defined Remote Configurations

The R home directory, installation locations and R libraries for remote R environments are defined by the server running on the remote system. Therefore most options of the local R environments configurations are not available for remote environments.

The 'index directory' specifies the directory containing the index of the R environment (e.g. for the R help). This allows to share the index among several clients, if they use a consistent R environment on the server. The directory must be accessible by the specified path from the local system. If the field is empty, the directory is selected automatically like for local R environment configurations.