安装ggplot“下标越界”错误 [英] Installing ggplot “subscript out of bounds” error
本文介绍了安装ggplot“下标越界”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$ R
R版本2.12.2(2011-02-25)
平台:i486-pc-linux-gnu(32位)
> install.packages(ggplot2,dep =T)
应用中的错误(可用[p1,dependencies,drop = FALSE],1L,function(x)paste(x [!is.na(x) ],:
下标越界
我可以怎样安装ggplot2? p>
解决方案
请阅读函数的帮助信息!?install.packages
:
依赖关系:逻辑指示还安装卸载的程序包
,这些程序包依赖于/建议/导入),也可以是
字符向量,是'c(Depends,Imports,
LinkingTo的子集,也可以是
)。 建议,增强)'。
所以这清楚地表明您需要提供逻辑值, TRUE
或 FALSE
。T
不是逻辑的 TRUE
,也不是 T
,总是拼出 T RUE
和 FALSE
,否则您可能会遇到很多麻烦。保存几次击键是不值得的。
正如我在上一个问答的答案中所显示的那样:
R> install.packages(ggplot2,dependencies = TRUE)
的作品。那么,为什么你改变了我展示给你的工作?
$ 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?
解决方案
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?
这篇关于安装ggplot“下标越界”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文