我在使用简单的ggplot命令时遇到意外错误,而且我已经用尽所有网络搜索来查找类似的问题。
qplot(hp,mpg,data=mtcars)
Error in list2env(members, envir = e) :
names(x) must be a character vector of the same length as x
使用ggplot时同样适用...
ggplot(mtcars, aes(hp,mpg)) + geom_point()
Error in list2env(members, envir = e) :
names(x) must be a character vector of the same length as x
我过去从未遇到过这个问题,虽然我过了一段时间才使用ggplot。
我正在运行R 3.1.1,非常感谢任何帮助!
更新:sessionInfo
sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: i386-w64-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252
LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
LC_TIME=English_Australia.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_2.0.0
loaded via a namespace (and not attached):
[1] digest_0.6.8 htmltools_0.2.6 httpuv_1.3.3 jsonlite_0.9.19 mime_0.4
R6_2.1.1 Rcpp_0.12.2 tools_3.1.1 xtable_1.8-0
干杯
答案 0 :(得分:8)
当我将R更新为3.2.3
时,它可以正常工作这需要一些管理请求(工作机器),但它现在全部排序。
sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252
LC_MONETARY=English_Australia.1252
[4] LC_NUMERIC=C LC_TIME=English_Australia.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_2.0.0
loaded via a namespace (and not attached):
[1] labeling_0.3 colorspace_1.2-6 scales_0.3.0 plyr_1.8.3
tools_3.2.3 gtable_0.1.2 Rcpp_0.12.2 grid_3.2.3
[9] munsell_0.4.2