1

We use R at my university, where all computers run Windows XP or Windows 7 and read/write access to most places on the C drive is disabled. This includes the default directory for downloading and installing R packages, but does not include the Downloads folder, so I've been using this work-around:

install.packages("plyr",lib="C:/Users/g-rde434/Downloads/")
library(plyr,lib.loc="C:/Users/g-rde434/Downloads/")

where g-rde434 is the username and I'm just using plyr as an example. For packages that require a lot of other packages in order to work, this gets messy because I've found that I have to manually install all the depends before I can install the package I actually want to use. For instances, packages like ggplot2 and sirt each require a whole bunch of other packages to work properly. Is there a much easier way to do what I'm trying to do? I'm not asking about clever vectorizing tricks or anything like that, but rather some way to force the "higher-up" packages (e.g., ggplot2 or sirt) to load all the other packages it needs from the library location I specified above?

Jon
  • 753
  • 8
  • 18
  • Might this help: `install.packages("plyr", lib="C:/Users/g-rde434/Downloads/", dependencies=TRUE)`. See http://stackoverflow.com/questions/14171148/how-to-tell-cran-to-install-package-dependencies-automatically – majom Feb 23 '14 at 15:51
  • 2
    R, at least on Linux, if it can't write to the system library asks me if I want to create a personal library (in $HOME/R/...), and then all the dependencies go there too. Not true for Windows? What version of R? – Spacedman Feb 23 '14 at 16:33
  • 2
    Spacedman's answer should apply to Windows, as well. Try something like: `.libPaths('C:/Users/g-rde434/Downloads/')` – Thomas Feb 23 '14 at 17:30
  • I'll try the dependencies argument tomorrow (no access til then). @Spacedman we're on R 3.0.2. Thanks all for the suggestions. – Jon Feb 23 '14 at 19:31
  • @majom Yup, that did it -- thanks! If you put it as an answer I'll accept it. – Jon Feb 25 '14 at 14:00
  • Great. I have posted an answer. Perhaps it be might useful for others. – majom Feb 25 '14 at 19:37

1 Answers1

1

Please try:

install.packages("plyr", lib="C:/Users/g-rde434/Downloads/", dependencies=TRUE)

For further reference see: How to tell CRAN to install package dependencies automatically?

Community
  • 1
  • 1
majom
  • 7,863
  • 7
  • 55
  • 88