1

Where are the installed R packages?

For example, after installing packages with 'install.packages("mlbench")' and so on, only "The downloaded binary packages are in C:\Users\ABC\AppData\Local\Temp\Rtmp2XB0sh\downloaded_packages" is a piece of related info from the console messages.

However, I fail to find them at all after scouring my computer according to package names (not just listing them with 'installed.packages()'). This question seems very difficult for me, but strangely I found almost no answer online. Where are the installed packages on the local computer?

Tom
  • 3,168
  • 5
  • 27
  • 36

1 Answers1

8

You can view the location by running the following:

.libPaths()
#[1] "C:/Users/ujjwal/Documents/R/win-library/3.1" "C:/Program Files/R/R-3.1.1/library"   

R packages are installed into libraries, which are directories in the file system containing a subdirectory for each package installed there.

R comes with a single library, R_HOME/library which is the value of the R object .Library containing the standard and recommended packages. At the lowest level .libPaths() can be used to add paths to the collection of libraries or to report the current collection.

R will automatically make use of a site-specific library R_HOME/site-library if this exists. This location can be overridden by setting .Library.site in R_HOME/etc/Rprofile.site. For more details see here.

Ujjwal
  • 3,088
  • 4
  • 28
  • 36
  • Thanks a lot. I found that there are two R folders installed (one R and one RRO) in my computer, and I just searched the R folder previously. – Tom Jan 05 '15 at 14:56