无法安装ggplot2
我在将 ggplot2 安装到 R 中时遇到问题。我环顾四周,没有看到与我遇到的相同错误。
> 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?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
实际上,按如下方式调用就足够了:
并且 R 应该用默认位置替换
lib
,如我的评论中所示。或者您可以更改环境变量本身。
It would actually suffice to invoke as follows:
and R should substitue
lib
with the default location, as in my comment.Or you could change the environment variable itself.
R 需要对您的库具有写权限才能在其中安装包。您得到的其他建议很好,应该是首选,但是您可以以管理员身份运行 R(或 RStudio)(右键单击 .exe,然后选择“以管理员身份运行”选项),这应该为其提供写访问权限到你的图书馆。
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.
在RStudio中:
In RStudio: