Mikata-Project / ggthemr

Themes for ggplot2.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New error message after updated to ggplot

thomasjwood opened this issue · comments

I think some recent changes to ggplot2 internals have broken ggthemr. for instance

library(ggplot2)
library(ggthemr)

ggplot(mtcars, aes(wt, mpg)) + geom_point()

works fine

image

but invoking ggthemr

ggthemr("greyscale")

results in this error message

 Error: No geom called GeomJitter.
 In addition: Warning messages:
 1: `axis.ticks.margin` is deprecated. Please set `margin` property  of `axis.text` instead 
 2: New theme missing the following elements: panel.ontop, strip.switch.pad.grid, strip.switch.pad.wrap 

and an attempt to call ggplot:

ggplot(mtcars, aes(wt, mpg)) + geom_point() 

results in:

Error in if (theme$panel.ontop) { : argument is of length zero

hope this gets addressed--ggthemr produces fantastic looking plots!

> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)

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

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

other attached packages:
[1] ggthemr_1.0.1      devtools_1.8.0     ggplot2_1.0.1.9003

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.0       digest_0.6.8      grid_3.2.2        plyr_1.8.3.9000  
 [5] gtable_0.1.2      git2r_0.11.0      scales_0.2.5.9003 curl_0.9.2       
 [9] xml2_0.1.1        labeling_0.3      tools_3.2.2       munsell_0.4.2    
[13] rversions_1.0.2   colorspace_1.2-6  memoise_0.2.1 

Apologies for the slow reply, I didn't see this until now.

It does sound like something might have changed in ggplot. Looks like some new theme elements might have been added.

Thanks for reporting the issue, I will reply here when I have a solution.

Thanks!

It might have been something with the two versions of ggthemr and ggplotv I had installed, because a reinstall fixed this problem for me.

Thanks for a brilliant package!

Hi all,

Just a heads up that I'm seeing this issue too with the development version of ggplot2.

Restarting R session...

> library(ggthemr)
Loading required package: ggplot2
> ggthemr()
Error: No geom called GeomJitter.
In addition: Warning messages:
1: `axis.ticks.margin` is deprecated. Please set `margin` property  of `axis.text` instead 
2: New theme missing the following elements: panel.ontop, strip.switch.pad.grid, strip.switch.pad.wrap 
> devtools::session_info()
Session info -----------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.2.1 (2015-06-18)
 system   x86_64, darwin13.4.0        
 ui       RStudio (0.99.447)          
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       America/New_York            

Packages ---------------------------------------------------------------------------------------------------------
 package    * version    date       source                          
 colorspace   1.2-6      2015-03-11 CRAN (R 3.2.0)                  
 curl         0.9.3      2015-08-25 CRAN (R 3.2.0)                  
 devtools     1.8.0      2015-05-09 CRAN (R 3.2.0)                  
 digest       0.6.8      2014-12-31 CRAN (R 3.2.0)                  
 ggplot2    * 1.0.1.9003 2015-09-03 Github (hadley/ggplot2@816d789) 
 ggthemr    * 1.0.1      2015-09-03 Github (cttobin/ggthemr@17e4bf5)
 git2r        0.11.0     2015-08-12 CRAN (R 3.2.0)                  
 gtable       0.1.2      2012-12-05 CRAN (R 3.2.0)                  
 memoise      0.2.1      2014-04-22 CRAN (R 3.2.0)                  
 munsell      0.4.2      2013-07-11 CRAN (R 3.2.0)                  
 plyr         1.8.3      2015-06-12 CRAN (R 3.2.0)                  
 Rcpp         0.12.0     2015-07-25 CRAN (R 3.2.0)                  
 rversions    1.0.2      2015-07-13 CRAN (R 3.2.0)                  
 scales       0.3.0      2015-08-25 CRAN (R 3.2.0)                  
 xml2         0.1.2      2015-09-01 CRAN (R 3.2.0)

Everything works fine when using the current CRAN version of ggplot2 (1.0.1)

I looked into this quickly, and these lines are causing the trouble with my quick comments.

  1. https://github.com/cttobin/ggthemr/blob/master/R/theme_scales.R#L10 # 'jitter' 'freqpoly' no longer Geom*
  2. https://github.com/cttobin/ggthemr/blob/master/R/theme_scales.R#L15 # 'histogram', no longer Geom

Ah yes, ggplot2 looks like it made a lot of internal changes and anyone who tinkered with it is going to suffer a bit in the migration :) @hadley reassured that "There will be a length formal release process to make sure as many of these problems become known before ggplot2 is released on CRAN"

Fixed this with @sainathadapa's pull request.