1

交叉发布在 ggplot 的 Google 群组上

以下gglocator(ggplot2)的可重现示例:

library(ggplot2)
library(ggmap)
df <- data.frame(xvar = 1:10, yvar = 1:10)
qplot(xvar, yvar, data = df) + annotate(geom = 'point', x = 3, y = 6)
gglocator(4)

openSUSE 11.4 (64 bit)在以下情况下可以正常工作sessionInfo()

> sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C            
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8  
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8 
 [7] LC_PAPER=C                 LC_NAME=C               
 [9] LC_ADDRESS=C               LC_TELEPHONE=C          
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C     

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

other attached packages:
[1] ggmap_2.1     ggplot2_0.9.1

loaded via a namespace (and not attached):
 [1] colorspace_1.1-1   dichromat_1.2-4    digest_0.5.2       grid_2.15.1     
 [5] labeling_0.1       MASS_7.3-18        memoise_0.1        munsell_0.3     
 [9] plyr_1.7.1         png_0.1-4          proto_0.3-9.2      RColorBrewer_1.0-5
[13] reshape2_1.2.1     RgoogleMaps_1.2.0  rjson_0.2.8        scales_0.2.1    
[17] stringr_0.6      

Windows Vista运行时,相同的代码会引发错误(如标题所示)sessionInfo(),如下所示:

> sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: i386-pc-mingw32/i386 (32-bit)

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

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

上的ggplot2版本Windows0.9.2,上的版本Linux0.9.1

这是一个已知的错误,还是我错过了一点?

4

1 回答 1

1

我可以在 Windows 上重现该问题。

事实上ìn的代码gglocator

 x <- x[grep("panel-", grid.ls(print = message)[[1]])]

grep 找不到任何包含“面板-”的 grob。

当我删除 -

x[grep("panel", grid.ls(print = message)[[1]])]
[1] "panel.3-4-3-4"                    "panel.background.rect.5210"       "panel.grid.minor.y.polyline.5212" "panel.grid.minor.x.polyline.5214"
[5] "panel.grid.major.y.polyline.5216" "panel.grid.major.x.polyline.5218" "panel.border.zeroGrob.5207" 

对我来说,这没有理由在 linux 上工作。

于 2012-12-21T07:04:06.863 回答