|
Article ID: 542
Last updated: 25 Aug, 2026
R is a language and environment for statistical computing and graphics. For the NAS Athena system running the TOSS5 operating system, it is available after loading the cray-R module. For other NAS x86_64 systems running the TOSS4 operating system, is available through the NetBSD Packages Collection (pkgsrc). After invoking R, you can check the package name, location, and version included in the installation via the installed.packages() command. You can install additional R packages in your own directories for your own use. Recommendation: Pre-create a directory (such as ~/R-packages) and set the R_LIBS_USER environment variable before installing R packages. (See sample steps below.) Alternatively, you can use one of these methods to install R packages in your own directory:
Sample StepsIn the following sample steps, the recommended method described above is used to install the xts package (along with the zoo package, on which it has a dependency) on Athena. The example shows a few possible arguments you can choose for the install.packages function. Step 1: Pre-Create a DirectoryPre-create a directory and set the R_LIBS_USER environment variable:
Step 2: Load and Start RLoad a module that includes R and start R:
Note: If you want to run R on other NAS x86_64 systems, version 4.2.0 is available through pkgsrc/2023Q3, and version 4.5.2 is available through pkgsrc/2026Q1:
You may also need to load a newer gcc compiler if you encounter compilation errors during installation:
Step 3: Identify a Download Site for PackagesAt the R prompt >, choose one of the following methods to identify a download site for the packages from the Comprehensive R Archive Network (CRAN) and install the packages. Method 1
If you use this method, a list of secure CRAN mirror sites will appear on your screen or in a separate pop-up window. Choose one of the USA sites, for example, USA (TN), as a source for downloading the zoo and xts packages. Method 2
You can specify a different site, such as:
For all possible mirror sites, see https://cran.r-project.org/CRAN_mirrors.csv. Method 3
Additional ResourcesFor more information about R, including technical documentation, see the R Project website. |