tidyverse / ggplot2

An implementation of the Grammar of Graphics in R
https://ggplot2.tidyverse.org
Other
6.45k stars 2.02k forks source link

Error: could not find function "vec_run_sizes" for donut plots #5810

Closed jiw181 closed 5 months ago

jiw181 commented 5 months ago

I found a problem with donut plots after update the version of ggplot2 to 3.5.0 from 3.4.x The same script worked well but got this error now: " Error: ! Problem while converting geom to grob. ℹ Error occurred in the 1st layer. Caused by error in vec_run_sizes(): ! could not find function "vec_run_sizes" Run rlang::last_trace() to see where the error occurred. "

Here is the code to reproduce the bug (the same as the tutorial: https://rpkgs.datanovia.com/ggpubr/reference/ggdonutchart.html):

df <- data.frame(
  group = c("Male", "Female", "Child"),
  value = c(25, 25, 50))
ggdonutchart(df, "value", label = "group")

Here is the sessionInfo() "

sessionInfo() R version 4.1.3 (2022-03-10) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Monterey 12.2

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages: [1] forcats_0.5.2 stringr_1.4.1 dplyr_1.0.10 purrr_0.3.5
[5] tidyr_1.2.1 tibble_3.1.8 tidyverse_1.3.2 readr_2.1.3
[9] ggpubr_0.4.0 writexl_1.4.1 ggplot2_3.5.0 readxl_1.4.1

loaded via a namespace (and not attached): [1] fs_1.5.2 usethis_2.1.6 lubridate_1.8.0
[4] devtools_2.4.5 bit64_4.0.5 RColorBrewer_1.1-3 [7] httr_1.4.4 tools_4.1.3 profvis_0.3.7
[10] backports_1.4.1 utf8_1.2.2 R6_2.5.1
[13] DBI_1.1.3 colorspace_2.0-3 urlchecker_1.0.1
[16] withr_2.5.0 tidyselect_1.2.0 prettyunits_1.1.1
[19] processx_3.8.0 bit_4.0.4 compiler_4.1.3
[22] textshaping_0.3.6 cli_3.5.0 rvest_1.0.3
[25] pacman_0.5.1 xml2_1.3.3 labeling_0.4.2
[28] scales_1.3.0 callr_3.7.3 systemfonts_1.0.4
[31] digest_0.6.30 pkgconfig_2.0.3 htmltools_0.5.3
[34] sessioninfo_1.2.2 dbplyr_2.2.1 fastmap_1.1.0
[37] htmlwidgets_1.5.4 rlang_1.1.3 rstudioapi_0.14
[40] shiny_1.7.3 farver_2.1.1 generics_0.1.3
[43] jsonlite_1.8.3 vroom_1.6.0 car_3.1-1
[46] googlesheets4_1.0.1 magrittr_2.0.3 Rcpp_1.0.9
[49] munsell_0.5.0 fansi_1.0.3 abind_1.4-5
[52] lifecycle_1.0.3 stringi_1.7.8 carData_3.0-5
[55] pkgbuild_1.3.1 grid_4.1.3 parallel_4.1.3
[58] promises_1.2.0.1 crayon_1.5.2 miniUI_0.1.1.1
[61] haven_2.5.1 hms_1.1.2 ps_1.7.2
[64] pillar_1.8.1 ggsignif_0.6.4 pkgload_1.3.1
[67] reprex_2.0.2 glue_1.6.2 remotes_2.4.2
[70] BiocManager_1.30.19 modelr_0.1.9 vctrs_0.5.1
[73] tzdb_0.3.0 httpuv_1.6.6 cellranger_1.1.0
[76] gtable_0.3.1 assertthat_0.2.1 cachem_1.0.6
[79] mime_0.12 xtable_1.8-4 broom_1.0.1
[82] rstatix_0.7.0 later_1.3.0 ragg_1.2.4
[85] googledrive_2.0.0 gargle_1.2.1 memoise_2.0.1
[88] ellipsis_0.3.2 "

teunbrand commented 5 months ago

Thanks for the report! The problem is likely your vctrs version. I suspect it will go away if you update vctrs. We might need to state the minimum required vctrs version to be at least 0.6.0.

jiw181 commented 5 months ago

Thank you for the prompt response! Your suggestion worked. Update to vctrs_0.6.2 solved this error.