I recently updated to R version 4.4.0, which I’m using through RStudio (2024.04.0+735). ggplot2 won’t let me add a palette anymore and I’m going crazy.
Where is this ghost palette coming from? How can I get rid of the error?
In a fresh session with no attached packages, the following code produces an error:
ggplot2::ggplot() + ggplot2::scale_color_manual(palette = function(n) n)
The error reads:
Error in discrete_scale(aesthetic, name = name, palette = pal, breaks = breaks, :
formal argument “palette” matched by multiple actual arguments
Session info:
R version 4.4.0 (2024-04-24)
Platform: aarch64-apple-darwin20
Running under: macOS Sonoma 14.0
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: Asia/Jerusalem
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] utf8_1.2.4 R6_2.5.1 tidyselect_1.2.1 magrittr_2.0.3
[5] gtable_0.3.5 glue_1.7.0 tibble_3.2.1 pkgconfig_2.0.3
[9] generics_0.1.3 dplyr_1.1.4 lifecycle_1.0.4 ggplot2_3.5.1
[13] cli_3.6.2 fansi_1.0.6 scales_1.3.0 grid_4.4.0
[17] vctrs_0.6.5 compiler_4.4.0 rstudioapi_0.16.0 tools_4.4.0
[21] munsell_0.5.1 pillar_1.9.0 colorspace_2.1-0 rlang_1.1.3
rimonim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.