# [Rd] installing packages and libraries

Gabor Grothendieck ggrothendieck at gmail.com
Mon Jul 4 21:47:52 CEST 2005

```When I run the following:

cd \Rpkgs
rcmd install mypackage -l library

I get a message that it cannot find quadprog which is a library
that mypackage depends on.

I previously used C:\Program Files\R\rw2011\library as my library for CRAN
packages and did not have a problem but now that I use
C:\Program Files\R\library this problem has started.

I actually can get it to work by doing either of the following:

1. install quadprog into \Program Files\R\rw2011path\library
instead of in \Program Files\R\library, or

2. install mypackage into \Program Files\R\library via:

rcmd install mypackage -l c:\PROGRA~1\R\library

However, I can't seem to install mypackage into \Rpkgs\library
like I want due to the error I showed above.

I have \Program Files\R\rw2011pat\etc\Renviron.site set to my
library list (its contents are just the single line shown here):

R_LIBS=C:/PROGRA~1/R/library;C:/Rpkgs/library

and normally that works fine, e.g. when doing install.packages
to install a CRAN package, but I assume that it is not being
read by the installation program.  I also tried setting R_LIBS, viz.

C:\Rpkgs>set R_LIBS
R_LIBS="C:\Program Files\R\library;C:\Rpkgs\library;C:\Program Files\R\rw2011pat
\library"

but that does not help.  In fact, if I do that I get this message:

list.files: 'C:/Program Files/R/rw2011pat/library"' is not a readable directory

even though that directory is valid as I double checked it.

I have looked at ?Startup and the Admin Manual and the Writing Extensions