Skip to content

Installing R dependencies

  • Load R module

    module load R/4.0.5
    
  • to know which R packages are installed, under R :

    ip = as.data.frame(installed.packages()[,c(1,3:4)])
    ip = ip[is.na(ip$Priority),1:2,drop=FALSE]
    ip
    
  • Define the directory where you want to store the R packages you want to add. You can add this variable to your .bashrc file.

    export R_LIBS_USER="/homedata/user/R_LIBS"
    
  • Launch R interpreter

    R
    
  • Install your packages in R interpreter

    install.packages("my_package")
    

Important

Never change the path in the variable R_LIBS because you will lose access to all the packages installed by default.