Skip to content

Commit 79ff57a

Browse files
committed
update_(geom|stat)_defaults(): use aes() instead of list()
1 parent 86c4076 commit 79ff57a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

R/geom-defaults.r

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@
1111
#' # updating a geom's default aesthetic settings
1212
#' # example: change geom_point()'s default color
1313
#' GeomPoint$default_aes
14-
#' update_geom_defaults("point", list(color = "red"))
14+
#' update_geom_defaults("point", aes(color = "red"))
1515
#' GeomPoint$default_aes
1616
#' ggplot(mtcars, aes(mpg, wt)) + geom_point()
1717
#'
1818
#' # reset default
19-
#' update_geom_defaults("point", list(colour = "black"))
19+
#' update_geom_defaults("point", aes(color = "black"))
2020
#'
2121
#'
2222
#' # updating a stat's default aesthetic settings
2323
#' # example: change stat_bin()'s default y-axis to the density scale
2424
#' StatBin$default_aes
25-
#' update_stat_defaults("bin", list(y = expr(after_stat(density))))
25+
#' update_stat_defaults("bin", aes(y = after_stat(density)))
2626
#' StatBin$default_aes
2727
#' ggplot(data.frame(x = rnorm(1e3)), aes(x)) +
2828
#' geom_histogram() +
2929
#' geom_function(fun = dnorm, color = "red")
3030
#'
3131
#' # reset default
32-
#' update_stat_defaults("bin", list(y = expr(after_stat(density))))
32+
#' update_stat_defaults("bin", aes(y = after_stat(count)))
3333
#'
3434
#' @rdname update_defaults
3535
update_geom_defaults <- function(geom, new) {

man/update_defaults.Rd

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)