Reputation: 181
I'm having trouble installing ggplot2 into R. I've looked around here and haven't seen the same error that I'm getting.
> install.packages('ggplot2', dep=TRUE)
Warning in install.packages("ggplot2", dep = TRUE) :
'lib = "C:/Program Files/R/R-2.13.1/library"' is not writable
Error in install.packages("ggplot2", dep = TRUE) :
unable to install packages
Can anybody help?
Upvotes: 3
Views: 17753
Reputation: 1
In RStudio:
Upvotes: -1
Reputation: 146164
R needs to have write access to your library to install a package there. The other advice you're getting is good and should be preferred, but you can run R (or RStudio) as an administrator (right-click on the .exe and "Run as Administrator" is an option) which should give it write access to your library.
Upvotes: 3
Reputation: 1390
It would actually suffice to invoke as follows:
> install.packages('ggplot2', dep=TRUE, lib=NULL)
and R should substitue lib
with the default location, as in my comment.
Or you could change the environment variable itself.
Upvotes: 8