$ 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?
答案 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")’.
因此,这清楚地表明您需要提供逻辑值,TRUE
或FALSE
。 "T"
不是逻辑TRUE
,也不是T
。总是拼出TRUE
和FALSE
,否则你会遇到很多麻烦。保存几次按键是不值得的。
正如我在前一个问题的答案中所表明的那样:
R> install.packages("ggplot2", dependencies = TRUE)
的工作原理。那么你为什么要改变我所展示的作品呢?