How to install a R package into Sandbox?
Last updated
Last updated
Go to alphabetical list of all cran r-project packages at cran web page
Find your R package and click the package name to open the package page. For example, Reticulate package
Load the package to your local machine (from Package source line, red arrow in Figure 1)
Fig 1)
Check if all dependences (green arrow) are already in your Sandbox
Open RStudio and type
ListOfPackages = library()$results[,1]
Then go through all dependences (indicated by green arrow in Figure 1) to check if they are already found.
'Name_of_package' %in% ListOfPackages
Example: 'Matrix' %in% ListOfPackages
If the package is found, R returns TRUE. If not, R returns FALSE.
If dependences are not found load them to your local machine as well.
After you have R packages you need on your local machine, load them to FinnGen green bucked by follow uploading instructions in section “How to upload to your own IVM via /finngen/green”.
Install your packages. In Sandbox RStudio console or in R type
install.packages("/finngen/green/reticulate_1.20.tar.gz ", 'path/to_your_gnu_library_folder', repos = NULL, type="source")
You can check the name and path of your gnu library folder with your file manager. It is something like /home/ivm/R/x86_64-pc-linux-gnu-library/4.1.
That’s it. You can now call your library in R / RStudio as usual, e.g. at the console: library(reticulate)