lionel- / ggstance

Horizontal ggplot2 components
201 stars 19 forks source link

geom_violinh fails with warning to "Please use `to_lower_ascii()`" with newly-released ggplot2 #30

Closed mjskay closed 5 years ago

mjskay commented 5 years ago

If I install the development version most recent CRAN release of ggplot2, the following code generates a warning and does not draw the violin plot (it works fine if the current CRAN release version of ggplot2 is installed):

library(ggstance)
library(ggplot2)

ggplot(data.frame(x = rnorm(1000), y = "a"), aes(x, y)) +
  geom_violinh()
Warning message:
Computation failed in `stat_xdensity()`:
Please use `to_lower_ascii()`, which works fine in all locales.

I couldn't easily track down where this is coming from (because I don't see a call to tolower() anywhere?), but I assume it is related to this change in ggplot2: https://github.com/tidyverse/ggplot2/pull/3011

geom_violin seems to still work:

library(ggplot2)
library(ggstance)

ggplot(data.frame(y = rnorm(1000), x = "a"), aes(x, y)) +
  geom_violin()

image

So I am assuming the issue is somewhere in ggstance.

sessionInfo() output is below.

R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

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] ggstance_0.3.1     ggplot2_3.1.0.9000

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1       withr_2.1.2      assertthat_0.2.1 crayon_1.3.4     dplyr_0.8.0.1    R6_2.4.0         grid_3.5.2      
 [8] gtable_0.2.0     magrittr_1.5     scales_1.0.0     pillar_1.3.1     rlang_0.3.2      lazyeval_0.2.2   rstudioapi_0.10 
[15] labeling_0.3     tools_3.5.2      glue_1.3.1       purrr_0.3.2      munsell_0.5.0    yaml_2.2.0       compiler_3.5.2  
[22] pkgconfig_2.0.2  colorspace_1.4-1 tidyselect_0.2.5 tibble_2.1.1 
mjskay commented 5 years ago

@lionel- is there any update on this? geom_violinh() now appears to be broken on CRAN due to the recently-released version of ggplot2, on both Windows and Linux systems I have tested.

mjskay commented 5 years ago

Nevermind, this looks like it is fixed in the github version --- my bad for testing on the CRAN version and not the github version.

lionel- commented 5 years ago

No worries, I need to release ggstance anyway for 3.2.0 compatibility.