0

I am trying to install some R packages on my account on the HPC cluster. However when I do that I get the following error:

no permission to install to directory '/gpfs1/apps/sw/R/R-3.6.1/lib64/R/library' 

I have contacted the admin and he told me I do need admin privilages to install anything to /gpfs1/apps/sw/. He told I must rather do that in the home directory.

How can I switch to the home directory on my account ? The admin has already installed some other R packages on my account but I need to install some myself ? How do I know where my R packages are on the home directory and how to install everything there ?

Output of .libPaths()

"/gpfs1/apps/sw/R/R-3.6.1/lib64/R/library"

Update

Using the following tutorial I am now able to install R packages in my home directory on the cluster using the following command:

export R_LIBS_USER=/home/rcf-proj/tt/trojan/R/parallel:$R_LIBS_USER

which adds the path above to .libPaths(). However, when running my R script it keeps referring to the original location /gpfs1/apps/sw/R/R-3.6.1/lib64/R/library where I don't have the packages I installed in my HOME directory. Especially that after I restart R, I must always do this command.

In the answers here They recommended I edit the .libPaths() in the .Rprofile file, but I cannot seem to find it on my cluster account. The same issue is still open here

I have read it somewhere that we car create a .Rprofile ourselves, but how can I do this and what must I put in it ??

Community
  • 1
  • 1
Perl Del Rey
  • 959
  • 1
  • 11
  • 25
  • You could pass a `lib` argument to `install.packages` **lib** *character vector giving the library directories where to install the packages. Recycled as needed. If missing, defaults to the first element of .libPaths().* (see `?install.packages`) – dario Mar 08 '20 at 11:36
  • @dario can I change the default _.libPaths()_ to any current directory ? – Perl Del Rey Mar 08 '20 at 11:57
  • It should be one of the values in the output of `.libPaths()`. What do you get as its output? – dario Mar 08 '20 at 12:03
  • @dario each time I re-start R, only the one that needs admin access is shown in _.libPaths_. So only this: ```"/gpfs1/apps/sw/R/R-3.6.1/lib64/R/library"``` – Perl Del Rey Mar 08 '20 at 12:04
  • Maybe you find some useful information in one of the answers [here](https://stackoverflow.com/questions/15170399/change-r-default-library-path-using-libpaths-in-rprofile-site-fails-to-work) – dario Mar 08 '20 at 12:06
  • I advise you to install R using a HPC package manager such as [Spack](https://spack.readthedocs.io/en/latest/). It should do all the configuration for you and can install packages in your HOME directory. – Jérôme Richard Mar 08 '20 at 14:36
  • @JérômeRichard Thank you, I am now able to install the packages in the home directory, but still when running my R scripts it is reffering to the libraries that are not in the home, but rather here: ```"/gpfs1/apps/sw/R/R-3.6.1/lib64/R/library"``` which cannot be accessed except by admin. I cannot seem to find the ```.Rprofile``` on the cluster in order to override _.libPaths()_ [link](https://stackoverflow.com/questions/24387660/how-to-change-libpaths-permanently-in-r) – Perl Del Rey Mar 08 '20 at 18:59

0 Answers0