-
Notifications
You must be signed in to change notification settings - Fork 4
Using R Packages
This guide will show you how to setup your HPC account so that you can access the AidData REU R packages and also install and access your own R packages. Make sure the R module is loaded before attempting to run a job with R or open an R process to install packages.
- Log in to your HPC account
- Create / open a file called ".Renviron" >>
nano ~/.Renviron
- Add the following to the file:
R_LIBS="~/R_libs:/sciclone/aiddata10/REU/R_libs"
This tells any R process you start to look for packages in a folder called "R_libs" in your home directory (see below for details on installing packages to your home directory) and in the central AidData repository of R packages
You can now access any R packages available in the AidData central repository normally by using library(<package-name>)
in R
The packages available from the AidData central repository can be seen using ls /sciclone/aiddata10/REU/R_libs/
while logged in to sciclone. Note: additional packages not listed here may have been installed globally on sciclone. Such packages may be documented as an issue with the "software request" label (eg: rgdal)
To install and use packages not available through the AidData central repository take the following steps:
- make a new folder called R_libs in your home directory >>
mkdir ~/R_libs
- start a BASH shell by typing
bash
while logged into your HPC account - start R by typing
R
- install a package to your local R_libs folder >>
install.packages(<package-name>, lib="~/R_libs")
- select a CRAN repo to download from
You can now access your local R package normally using library(<package-name>)
- Geo Framework
- Overview
- SciClone Guides and Tutorials
- Getting Started
- Accessing and Transferring Files
- Drive Management
- Using R Packages
- Using Python Packages
- Software Dependencies