Hi ggplot2 experts,
I want to create a function that can update a series of geom defaults as to how I want them with ability to modify the inputs.
However, the function results in the value of the input taking on the argument name rather than the value of the argument.
Any ideas how to make it take on the value of the colour i.e. "red" in the example below?
library(tidyverse)
test <- function(colour = "red") {
update_geom_defaults("point", ggplot2::aes(colour = colour))
}
test()
GeomPoint$default_aes
#> Aesthetic mapping:
#> * `shape` -> 19
#> * `colour` -> `colour`
#> * `size` -> 1.5
#> * `fill` -> NA
#> * `alpha` -> NA
#> * `stroke` -> 0.5
Created on 2024-04-05 with reprex v2.1.0