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

时间:2011-04-02 11:41:13

标签: r 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

我该怎么做才能安装ggp​​lot2?

1 个答案:

答案 0 :(得分:5)

请阅读功能帮助!来自?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"不是逻辑TRUE,也不是T。总是拼出TRUEFALSE,否则你会遇到很多麻烦。保存几次按键是不值得的。

正如我在前一个问题的答案中所表明的那样:

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

的工作原理。那么你为什么要改变我所展示的作品呢?