开发者

Unable to install ggplot2

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.packag开发者_运维问答es('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?


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.


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.


In RStudio:

  • Try going to "Tools";
  • At the top you have "Install packages", click on that;
  • Then click on "Install to Library", change that to another library and save there.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜