Saving packages to your R Studio workspace


The EcoCloud has numerous packages pre-installed in R Studio which are ready to use. However, there are often specific packages needed that are not loaded but will be used frequently. 

To increase efficiency it is possible to save packages to your R Studio workspace. To do this simply run the following lines at the beginning of each of your R Studio sessions and the packages you have installed during that session will be saved and available the next time you launch a server. 

dir.create(path.expand("~/workspace/.rstudio/library"), showWarnings = FALSE)
.libPaths("~/workspace/.rstudio/library")


You can then proceed to use the R Studio workspace as usual and ensure you appropriately end your R session by using the 'quit R session' options in the 'file' tab.


Modified on: 2020-03-19 11:00:51 +1100

Did you find it helpful? Yes No

Can you please tell us how we can improve this article?