Skip to main content

R Packages Notes

We tend to install R with all the packages, so if you're finding one make sure that you are seeing the default install path. 

To see the installed packages (from an R prompt):

> installed.packages();

To find just one (one example of when it's there, another of when it's not):

> find.package("ggplot2")
[1] "/usr/lib64/R/library/ggplot2"

> find.package("ggplot3")
Error in find.package("ggplot3") : there is no package called ‘ggplot3’

To see the library paths:

> .libPaths()
[1] "/usr/lib64/R/library"                               
[2] "/usr/share/R/library"    

To add library paths:

libPaths(c( .libPaths(), "/usr/local/lib/R/site-library", "/usr/lib/R/site-library" ,"/usr/lib/R/library"))

To load the library (note, no quotes):

> library(data.table)
data.table 1.14.8 using 32 threads (see ?getDTthreads).  Latest news: r-datatable.com