Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 无法运行任何子批示例_R_Ggplot2 - Fatal编程技术网

R 无法运行任何子批示例

R 无法运行任何子批示例,r,ggplot2,R,Ggplot2,我正在尝试从ggsubplot包的geom_子包帮助页面运行该示例 library(ggplot2) devtools::install_github('ggsubplot', 'garrettgman') library(ggsubplot) ggplot(nasa) + geom_subplot(aes(long, lat, group = id, subplot = geom_point(aes(surftemp, temperature), size = 1/4))) +

我正在尝试从
ggsubplot
包的
geom_子包
帮助页面运行该示例

library(ggplot2)
devtools::install_github('ggsubplot', 'garrettgman')
library(ggsubplot)

ggplot(nasa) +
  geom_subplot(aes(long, lat, group = id,
    subplot = geom_point(aes(surftemp, temperature), size = 1/4))) +
  coord_map()
我得到以下错误:

Error in layout_base(data, vars, drop = drop) : 
  At least one layer must contain all variables used for facetting
到目前为止,我尝试运行的每个ggsubplot示例都会出现相同的错误。我试过使用CRAN和github版本的ggsubplot。我敢打赌这与最新版本的ggplot2不兼容,但我对ggplot开发了解不够,无法自己诊断

R.version
               _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          3                           
minor          1.0                         
year           2014                        
month          04                          
day            10                          
svn rev        65387                       
language       R                           
version.string R version 3.1.0 (2014-04-10)
nickname       Spring Dance 

> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggsubplot_0.3.1 ggplot2_0.9.3.1 devtools_1.5   

loaded via a namespace (and not attached):
 [1] colorspace_1.2-4 digest_0.6.4     evaluate_0.5.5   grid_3.1.0       gtable_0.1.2     httr_0.3         labeling_0.2     MASS_7.3-32     
 [9] memoise_0.2.1    munsell_0.4.2    parallel_3.1.0   plyr_1.8.1       proto_0.3-10     Rcpp_0.11.1      RCurl_1.95-4.1   reshape2_1.4    
[17] scales_0.2.4     stringr_0.6.2    tools_3.1.0      whisker_0.3-2   

似乎不再维护包
ggsubplot

:

已从CRAN存储库中删除包“ggsubplot”

可以从存档中获得以前可用的版本

按照维修方的要求,于2016年1月11日存档garrett@rstudio.com.

在GitHub()上,最后一次提交可以追溯到2015年7月9日


使用
devtools::install_GitHub('garrettgman/ggsubplot')
从R 3.3.2下的GitHub安装失败,错误消息抱怨缺少函数
eval

str(nasa)是否显示了具有相应字段的结构?您的代码为我运行(在Win 7上运行的R 3.0.3 64位,新会话)。你试过重新启动R吗?谢谢你的评论,
str(nasa)
很好,它显示了所有必要的列。我能够在R3.0.3中运行我的代码,所以这似乎是ggsubplot和R3.1.0的问题,或者可能是对应于R3.1.0的ggplot2版本的问题。我在R3.1.0中也有同样的问题。谢谢分享!我在github上发布了一个问题: