How do I install R packages on the Karst RStudio Server?

At Indiana University, UITS operates a web-accessible instance of RStudio Server on the Karst research computing cluster. Users can install R packages in their Karst home directories.

The following example creates a directory called r-packages and writes a line in the file .Renviron. This file stores the system variable R_LIBS_USER.

system("mkdir ~/r-packages")
setwd("~/r-packages")

fileName <- file(".Renviron")
x="R_LIBS_USER = \"~/r-packages\""
writeLines(x, fileName)
close(fileName)

After creating the .Renviron file, you can install packages from the CRAN repository with the install.packages command:

install.packages("my_r_pkg")

This is document apho in the Knowledge Base.
Last modified on 2017-11-29 10:56:09.

  • Fill out this form to submit your issue to the UITS Support Center.
  • Please note that you must be affiliated with Indiana University to receive support.
  • All fields are required.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.