安装ggp​​lot“下标越界”错误

发布于 2024-10-28 12:36:05 字数 290 浏览 1 评论 0原文

$ R
R version 2.12.2 (2011-02-25)
Platform: i486-pc-linux-gnu (32-bit)

> install.packages("ggplot2", dep="T")
Error in apply(available[p1, dependencies, drop = FALSE], 1L, function(x)  paste(x[!is.na(x)],  : 
  subscript out of bounds

我可以做什么来安装 ggplot2?

$ R
R version 2.12.2 (2011-02-25)
Platform: i486-pc-linux-gnu (32-bit)

> install.packages("ggplot2", dep="T")
Error in apply(available[p1, dependencies, drop = FALSE], 1L, function(x)  paste(x[!is.na(x)],  : 
  subscript out of bounds

What can I do to install ggplot2?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

鱼忆七猫命九 2024-11-04 12:36:05

请阅读函数的帮助!从 ?install.packages 中我们可以得到:

dependencies: logical indicating to also install uninstalled packages
          on which these packages depend/suggest/import (and so on
          recursively).  Not used if ‘repos = NULL’.  Can also be a
          character vector, a subset of ‘c("Depends", "Imports",
          "LinkingTo", "Suggests", "Enhances")’.

因此,这清楚地表明您需要提供一个逻辑值,即 TRUEFALSE"T" 不是逻辑上的 TRUET 也不是真正的。始终拼写出 TRUEFALSE 否则您可能会遇到很多麻烦。不值得为了节省几次击键而麻烦。

正如我在上一个问题的回答中所表明的:

R> install.packages("ggplot2", dependencies = TRUE)

有效。那么你为什么要改变我向你展示的有效内容呢?

Do read the help for functions! From ?install.packages we have:

dependencies: logical indicating to also install uninstalled packages
          on which these packages depend/suggest/import (and so on
          recursively).  Not used if ‘repos = NULL’.  Can also be a
          character vector, a subset of ‘c("Depends", "Imports",
          "LinkingTo", "Suggests", "Enhances")’.

So this clearly states that you need to supply a logical value, a TRUE or a FALSE. "T" is not a logical TRUE and neither is T really. Always spell out TRUE and FALSE otherwise you could get into lots of trouble. It isn't worth the hassle to save on a few keystrokes.

As I showed in the answer to the previous Q:

R> install.packages("ggplot2", dependencies = TRUE)

works. So why did you alter what I showed you did work?

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