IndrajeetPatil / ggstatsplot

Enhancing {ggplot2} plots with statistical analysis 📊📣
https://indrajeetpatil.github.io/ggstatsplot/
GNU General Public License v3.0
1.99k stars 184 forks source link

zero-length inputs cannot be mixed with those of non-zero length with ggbetweenstats because of StatsExpression 1.5.2 #881

Closed michoug closed 1 year ago

michoug commented 1 year ago

Hi When running this command:

library(ggstatsplot)
ggbetweenstats(dat = mtcars,x = cyl, y = mpg, type = "np")

I got this error,

Error in mapply(FUN = f, ..., SIMPLIFY = FALSE) : 
  zero-length inputs cannot be mixed with those of non-zero length

I gather it's because there is a difference in the number of values assigned to each cyl

    cyl     n
  <dbl> <int>
1     4    11
2     6     7
3     8    14

As it was working a few weks ago, I downgraded StatsExpression to version 1.5.1 instead of 1.5.2 and it resolved my issue

Here my sessioninfo()

R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=French_Switzerland.1252  LC_CTYPE=French_Switzerland.1252    LC_MONETARY=French_Switzerland.1252 LC_NUMERIC=C                       
[5] LC_TIME=French_Switzerland.1252    
system code page: 65001

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

other attached packages:
 [1] statsExpressions_1.5.2 ggstatsplot_0.12.0     lubridate_1.9.2        forcats_1.0.0          stringr_1.5.0          dplyr_1.1.3           
 [7] purrr_1.0.2            readr_2.1.4            tidyr_1.3.0            tibble_3.2.1           ggplot2_3.4.3          tidyverse_2.0.0       

loaded via a namespace (and not attached):
 [1] bit64_4.0.5        insight_0.19.4     tools_4.1.2        backports_1.4.1    utf8_1.2.3         R6_2.5.1           colorspace_2.1-0   withr_2.5.0       
 [9] tidyselect_1.2.0   bit_4.0.5          compiler_4.1.2     textshaping_0.3.6  cli_3.6.1          prismatic_1.1.1    labeling_0.4.3     bayestestR_0.13.1 
[17] BWStest_0.2.2      scales_1.2.1       mvtnorm_1.2-3      mc2d_0.2.0         multcompView_0.1-9 systemfonts_1.0.4  WRS2_1.1-4         pkgconfig_2.0.3   
[25] fastmap_1.1.1      rlang_1.1.1        rstudioapi_0.15.0  SuppDists_1.1-9.7  farver_2.1.1       generics_0.1.3     vroom_1.6.3        car_3.1-2         
[33] magrittr_2.0.3     parameters_0.21.1  patchwork_1.1.3    Rcpp_1.0.11        munsell_0.5.0      fansi_1.0.4        abind_1.4-5        lifecycle_1.0.3   
[41] stringi_1.7.12     carData_3.0-5      MASS_7.3-54        plyr_1.8.8         grid_4.1.2         paletteer_1.5.0    parallel_4.1.2     ggrepel_0.9.3     
[49] crayon_1.5.2       PMCMRplus_1.9.7    hms_1.1.3          zeallot_0.1.0      pillar_1.9.0       ggpubr_0.6.0       boot_1.3-28        ggsignif_0.6.4    
[57] effectsize_0.8.5   kSamples_1.2-9     glue_1.6.2         renv_1.0.0         vctrs_0.6.3        tzdb_0.4.0         gtable_0.3.4       rematch2_2.1.2    
[65] reshape_0.8.9      datawizard_0.8.0   cachem_1.0.8       correlation_0.8.4  broom_1.0.5        Rmpfr_0.9-3        rstatix_0.7.2      ragg_1.2.5        
[73] memoise_2.0.1      gmp_0.7-2          timechange_0.2.0  
IndrajeetPatil commented 1 year ago

I can't actually reproduce this, but maybe because this issue is already fixed in the development version of ggstatsplot.

Can you run the following command, refresh your R session, and then run the code you mentioned again?

remotes::install_github("IndrajeetPatil/ggstatsplot")

I plan to submit updated ggstatsplot to CRAN soon (even today).

IndrajeetPatil commented 1 year ago

Please re-open if the issue persists.

michoug commented 1 year ago

Hi, Sorry didn't saw the answer Yes it's working now, thanks!