【问题标题】:Mysterious R ggplot error - Error in list2env(members, envir = e)神秘的 R ggplot 错误 - list2env 中的错误(成员,envir = e)
【发布时间】:2016-03-28 03:51:39
【问题描述】:

我在使用简单的 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()
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   

干杯

【问题讨论】:

  • 你的 sessionInfo()..update ggplot2 是什么
  • 使用 sessionInfo() 更新帖子
  • 对不起,我想我在加载 ggplot 之前使用了 sessionInfo(),试图重新安装它....更新了上面的 Sessioninfo.. 我仍然遇到同样的错误。跨度>
  • 代码适用于 ggplot 1.0.1,但我知道它刚刚得到了更新,并且 hadley 说事情可能会中断(显然他不喜欢向后兼容)。我会更新,看看我是否遇到与@An​​es_thetize 相同的问题
  • 更新 ggplot2 后,这些命令对我来说工作正常。

标签: r ggplot2 environment-variables rstudio environment


【解决方案1】:

当我将 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

【讨论】:

  • 将其标记为正确,否则它将永远作为“未回答的问题”存在
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-12-08
  • 2015-03-13
  • 2017-04-20
  • 2014-06-07
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多