Skip to content

update_geom_defaults() should class results #5145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dkahle opened this issue Jan 11, 2023 · 0 comments
Closed

update_geom_defaults() should class results #5145

dkahle opened this issue Jan 11, 2023 · 0 comments

Comments

@dkahle
Copy link
Contributor

dkahle commented Jan 11, 2023

Using update_geom_defaults() and update_stat_defaults() don't class the updated list, so it prints differently. Example below. Will submit simple PR to fix presently.

library("ggplot2")

GeomPoint$default_aes
#> Aesthetic mapping: 
#> * `shape`  -> 19
#> * `colour` -> "black"
#> * `size`   -> 1.5
#> * `fill`   -> NA
#> * `alpha`  -> NA
#> * `stroke` -> 0.5

str(GeomPoint$default_aes)
#> List of 6
#>  $ shape : num 19
#>  $ colour: chr "black"
#>  $ size  : num 1.5
#>  $ fill  : logi NA
#>  $ alpha : logi NA
#>  $ stroke: num 0.5
#>  - attr(*, "class")= chr "uneval"

update_geom_defaults("point", list(size = 4))

GeomPoint$default_aes
#> $size
#> [1] 4
#> 
#> $shape
#> [1] 19
#> 
#> $colour
#> [1] "black"
#> 
#> $fill
#> [1] NA
#> 
#> $alpha
#> [1] NA
#> 
#> $stroke
#> [1] 0.5

class(GeomPoint$default_aes) <- "uneval"
GeomPoint$default_aes
#> Aesthetic mapping: 
#> * `size`   -> 4
#> * `shape`  -> 19
#> * `colour` -> "black"
#> * `fill`   -> NA
#> * `alpha`  -> NA
#> * `stroke` -> 0.5

Created on 2023-01-11 with reprex v2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant