Install and load R packages on Big Red II at IU

R is a language and environment for statistical computing and graphics. R provides a wide variety of statistical (for example, linear and nonlinear modeling, classical statistical tests, time-series analysis, classification, and clustering) and graphical techniques, and is highly extensible. For more, see the R Project for Statistical Computing home page.

To use R on Big Red II, you first must add it to your user environment; for instructions, see Use R on Big Red II at IU.

On this page:

Note:

Big Red II will be retired from service on December 15, 2019. After that date, you will no longer be able to log into Big Red II; however, the data in your Big Red II home directory will remain accessible from your home directory on any of the other IU research supercomputers. New software requests for Big Red II will no longer be accepted after the October 13, 2019, maintenance window.

Beginning October 14, 2019, IU graduate students, faculty, and staff will be able to create accounts on Big Red III. Undergraduate students and affiliates will be able to get accounts if they are sponsored by full-time IU faculty or staff members. Grand Challenges users who create Big Red III accounts will be able to request exclusive access to a portion of the system for running jobs.

For more, see Upcoming changes to research supercomputers at IU.


Install R packages

You can install R packages in your Big Red II home directory using either of the following methods. Before you begin, create a subdirectory for your package (for example, ~/r-packages); on the command line, enter:

  mkdir r-packages
  • Installing from a locally stored source file: To use a package source file stored in your Big Red II home directory (for example, ~/my_r_pkg) to install an R package to your R package subdirectory (for example, ~/r-packages), on the command line, enter:
      R CMD INSTALL my_r_pkg -l ~/r-packages
    
  • Installing from the CRAN package repository: To download and install a package (for example, my_r_pkg) from the CRAN package repository and install it in your R package subdirectory (for example, ~/r-packages), launch R, and then, at the R command prompt (>, enter:
      install.packages("my_r_pkg", lib="~/r-packages/")
    

Continue to Load R packages.

Load R packages

In R, to load your newly installed package (for example, ~/r-packages/my_r_pkg), at the R command prompt, enter:

  library("my_r_pkg", lib.loc="~/r-packages/")

For more details, type ?INSTALL in the R console.

Get help

If you have questions about using statistical and mathematical software at Indiana University, contact the UITS Research Applications and Deep Learning team.

This is document bfrs in the Knowledge Base.
Last modified on 2019-08-01 13:02:54.

Contact us

For help or to comment, email the UITS Support Center.