marcrichter marcrichter - 1 year ago 87
R Question

Where does R (for Windows) store packages before it installs them?

I am aware of where the installed packages go! ICMY, it's nicely outlined here:

Where does R store packages?

However, I do wonder where R caches the ZIP files (assuming Windows) it downloads from CRAN, i.e. prior to installing them in the library.

Any help most appreciated!

Answer Source

From the documentation for install.package :

destdir (parameter, default=NULL) : directory where downloaded packages are stored. If it is NULL (the default) a subdirectory downloaded_packages of the session temporary directory will be used (and the files will be deleted at the end of the session).

The session's temp dir is given by tempdir() command