无法安装ggp​​lot2

发布于 2024-12-03 21:43:12 字数 338 浏览 0 评论 0原文

我在将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

鸩远一方 2024-12-10 21:43:12

实际上,按如下方式调用就足够了:

> install.packages('ggplot2', dep=TRUE, lib=NULL)

并且 R 应该用默认位置替换 lib ,如我的评论中所示。

或者您可以更改环境变量本身。

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.

淡淡離愁欲言轉身 2024-12-10 21:43:12

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.

苍景流年 2024-12-10 21:43:12

RStudio中:

  • 尝试转到“工具”;
  • 顶部有“安装软件包”,点击它;
  • 然后单击“安装到库”,将其更改为另一个库并保存在那里。

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.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文