...
Code Block |
---|
module load r/4.2.12 |
To make R 4.2.1 autoload on login
Code Block |
---|
module initadd r/4.2.12 |
Interactive R use with slurm
...
Code Block |
---|
module purge module load r/4.2.12 R ... # here will be the interactive commands with R exit |
Please, DO NOT FORGET to EXIT from the nodes so that the other users can use it.
Here is an alterative option to run an interactive R session with 24 cores using the “general” partition
To list available versions of R, type
Code Block |
---|
srun -N 1 -n 128 -p general --constraint='epyc128' --pty bash |
At the time of writing, the most up-to-date version installed on the cluster is 4.1.2. To load it, run
Code Block |
---|
module purge
module load r/4.2.2
R
... # here will be the interactive commands with R
exit |
Install an R package
Local package install
...
Info |
---|
You can use whichever name you prefer for the |
...
Code Block |
---|
R .libPaths("~/rlibs") install.packages("data.table", lib = "~/rlibs", repo = "https://cloud.r-project.org/") |
Note that:
We need to specify the repo from which the packages will be downloaded from. For a list of options, take a look at https://cran.r-project.org/mirrors.html.
We need to set
lib
when installing the package to tell R where to install it.
Now, whenever you start a new R session or use Rscript
to run something, you will need to tell R that your packages are stored in the ~/rlibs
directory. There are two ways to do it. In the first one, is to add
...
Code Block |
---|
echo '.libPaths("~/rlibs")' > .Rprofile |
Info |
---|
Other A text editors editor (such as |
...