You need to have specific permissions to create, modify and use code environments. If you do not have these permissions, contact your DSS administrator.
Create a code environment¶
- Go to Administration > Code envs
- Click on “New R env”
- Give an identifier to your code environment. Only use A-Z, a-z, digits and hyphens
Code environment identifiers must be globally unique to the DSS instance, so use a complete and descriptive identifier
- Click on create
- DSS creates the code environment and installs the minimal set of packages
- You are taken to the new environment page
Given that compiling R packages from source takes time, it is advised to use Conda when available for code environment, and benefit from pre-compiled packages.
You can manage the list of packages to install by clicking on the “Packages to install” tab.
You see here two lists:
- A non-editable list of the “base packages”. These are packages that are required by your current settings. These packages cannot be removed, and you cannot modify their version. For more information, see Base packages
- An editable list of “Requested packages”. This is where you write the list of packages that you want in your virtual environment.
The list of requested packages is a table whose columns are the package name, and the package version, and the rows are the desired packages. The package version is optional.
- If the version is not filled, the latest version of the package is pulled only if the package is not installed
- If the version is filled, the latest version of the package is pulled only if the package is not installed, or the version is lower than the requested version
"dplyr",pulls the latest version of dplyr, only if dplyr is not yet installed
"RJSONIO","1.3"pulls the latest version of RJSONIO, only if RJSONIO is not yet installed, or in a older version
It is not possible to request a specific version of a package. If you want to update a package that is already installed, either add an entry with a higher version, or use “Clean env” checkbox.
Once you have written the packages you want, click on Save and update. DSS downloads and installs the newly required packages
Afterwards, you can inspect the exact installed versions in the “Actually installed packages” tab.
Using different package repositories¶
R packages not installed via Conda are pulled from repositories that mirror CRAN, and there is regularly a need to use a particular mirror (most often because of the availability of older versions). When DSS is installed on a machine without outgoing internet access, there is also a need to use a packaged CRAN repository hosting on the internal network.
To work with both these cases, the user can override the default CRAN mirror in Administration > Settings > Misc, and even override it on a per-code environment basis in the Extra Options, by unchecking “Inherit global settings”. This lets the user pass an URL to point to the R packages repository.