第一次尝试使用ggplot2,代码非常简单,但会产生错误:
a <- c(1,2,3)
b <- c(2,3,4)
> qplot(a,b)
Error in .Call("split_indices", group, as.integer(n)) :
"split_indices" not resolved from current namespace (plyr)
> ggplot(data.frame(a,b), aes(a,b)) +geom_line()
Error in .Call("split_indices", group, as.integer(n)) :
"split_indices" not resolved from current namespace (plyr)
我验证了plyr已安装(v1.8)和ggplot2(v0.9.3.1)。几乎任何我可以在网上找到的例子都会发生同样的错误..
这里有什么想法吗?
编辑:解决方案可能是在安装ggplot2软件包后重新启动RStudio。我怀疑这是在发布问题之前完成的,但不确定。
答案 0 :(得分:0)
我认为你在这里遇到的问题是“&gt;”。 试试这个,这在我的最后起作用:
require(ggplot2)
a <- c(1,2,3)
b <- c(2,3,4)
qplot(a,b)