Bureaucrats, cc_docs_admin, cc_staff
2,879
edits
No edit summary |
No edit summary |
||
Line 61: | Line 61: | ||
This front-end will automatically pass scripting-appropriate options <tt>--slave</tt> and <tt>--no-restore</tt> to the R interpreter. These also imply the <tt>--no-save</tt> option, preventing the creation of useless workspace files on exit. Note that any calculations last more than two or three minutes should not be run on the login node of the cluster but inside of a [[Running jobs|job]]. | This front-end will automatically pass scripting-appropriate options <tt>--slave</tt> and <tt>--no-restore</tt> to the R interpreter. These also imply the <tt>--no-save</tt> option, preventing the creation of useless workspace files on exit. Note that any calculations last more than two or three minutes should not be run on the login node of the cluster but inside of a [[Running jobs|job]]. | ||
== Installing R packages == <!--T:18--> | == Installing R packages == | ||
To install packages from [https://cran.r-project.org/ CRAN], you can use | |||
=== install.packages() === | |||
<!--T:18--> | |||
To install packages from [https://cran.r-project.org/ CRAN], you can use <tt>install.packages</tt> while running an interactive R session on the cluster's login node. Many R packages are developed using the Gnu family of compilers so we recommend that you load a <tt>gcc</tt> [[Utiliser des modules/en|module]] before trying to install any R packages. Use the same version of the <tt>gcc</tt> for all packages you install. | |||
{{Command | {{Command | ||
|module load gcc/5.4.0 | |module load gcc/5.4.0 | ||
Line 82: | Line 86: | ||
Some packages require defining the environment variable <tt>TMPDIR</tt> before installing. | Some packages require defining the environment variable <tt>TMPDIR</tt> before installing. | ||
<!--T: | === Dependencies ===<!--T:5--> | ||
Some packages depend on external libraries which are already installed on our clusters. If the library you need is listed at [[Available software]], then load the appropriate [[Utiliser des modules/en|module]] before installing the package that requires it. | |||
| | |||
For example, the package <code>rgdal</code> requires a library called <code>gdal</code>. Running <code>module spider gdal/2.2.1</code> shows that it requires <code>nixpkgs</code> and <code>gcc</code> modules. If you took the advice above to load <code>gcc</code> then both these should already be loaded. Verify this by running | |||
<!--T:6--> | <!--T:6--> | ||
Line 96: | Line 96: | ||
}} | }} | ||
<!--T: | <!--T:9--> | ||
If < | If any package fails to install, be sure to read the error message carefully as it might give you details concerning additional modules you need to load. See [[Utiliser des modules/en|Using modules]] for more on the <code>module</code> family of commands. | ||
<!--T: | === Downloaded packages ===<!--T:22--> | ||
To install a package that you downloaded (i.e. not using <code>install.packages()</code>), you can install it as follow. Assuming the package is named <tt>archive_package.tgz</tt>, run the following command in a shell: | |||
{{Command | {{Command | ||
| | |R CMD INSTALL -l 'path for your local (home) R library' archive_package.tgz | ||
}} | }} | ||