cc_staff
311
edits
m (Update install packages to use module version and point to cran) |
(Added installation to local library directory) |
||
Line 96: | Line 96: | ||
|module load gcc/7.3.0 r/4.0.2 | |module load gcc/7.3.0 r/4.0.2 | ||
}} | }} | ||
==== Installing for a specific R version ==== | |||
For example, to install the <tt>sp</tt> package that provides classes and methods for spatial data, use the following command on a login node: | For example, to install the <tt>sp</tt> package that provides classes and methods for spatial data, use the following command on a login node: | ||
Line 111: | Line 112: | ||
<!--T:21--> | <!--T:21--> | ||
Some packages require defining the environment variable <tt>TMPDIR</tt> before installing. | Some packages require defining the environment variable <tt>TMPDIR</tt> before installing. | ||
==== Installing for one or many R versions ==== | |||
Specify the local installation directory according to currently R module that is loaded. | |||
{{Commands | |||
|mkdir -p ~/.local/R/$EBVERSIONR/ | |||
|export R_LIBS{{=}}~/.local/R/$EBVERSIONR/ | |||
}} | |||
Install the package. | |||
{{Command|R -e 'install.packages("sp", repos{{=}}"https://cloud.r-project.org/")'}} | |||
In your submission script, you then have to load the desired R module and set the local library directory with <tt>export R_LIBS=~/.local/R/$EBVERSIONR/</tt>. | |||
=== Dependencies === <!--T:5--> | === Dependencies === <!--T:5--> |