Skip to content

Commit 20861e2

Browse files
committed
Process comments
1 parent b30fce4 commit 20861e2

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

R/aes-evaluation.r

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
#' Control aesthetic evaluation
22
#'
3+
#' @description
34
#' Most [aesthetics][aes()] are mapped from variables found in the data.
45
#' Sometimes, however, you want to delay the mapping until later in the
56
#' rendering process. ggplot2 has three stages of the data that you can map
67
#' aesthetics from, and three functions to control at which stage aesthetics
78
#' should be evaluated.
89
#'
9-
#' @usage # These functions can be used inside the `aes()` function
10+
#' @description
11+
#' `after_stat()` replaces the old approaches of using either `stat()`, e.g.
12+
#' `stat(density)`, or surrounding the variable names with `..`, e.g.
13+
#' `..density..`.
14+
#'
15+
#' @usage
16+
#' # These functions can be used inside the `aes()` function
1017
#' # used as the `mapping` argument in layers, for example:
1118
#' # geom_density(mapping = aes(y = after_stat(scaled)))
1219
#'
@@ -80,9 +87,9 @@
8087
#' ```
8188
#'
8289
#' ## Complex staging
83-
#' If you want to map the same aesthetic multiple times, e.g. map `x` to a
84-
#' data column for the stat, but remap it for the geom, you can use the
85-
#' `stage()` function to collect multiple mappings.
90+
#' If you want to map the same aesthetic multiple times, e.g. map `x` to a
91+
#' data column for the stat, but remap it for the geom, you can use the
92+
#' `stage()` function to collect multiple mappings.
8693
#'
8794
#' ```r
8895
#' # Use stage to modify the scaled fill
@@ -102,10 +109,6 @@
102109
#' fun.data = ~ round(data.frame(mean = mean(.x), sd = sd(.x)), 2)
103110
#' )
104111
#' ```
105-
#' @note
106-
#' `after_stat()` replaces the old approaches of using either `stat()`, e.g.
107-
#' `stat(density)`, or surrounding the variable names with `..`, e.g.
108-
#' `..density..`.
109112
#' @rdname aes_eval
110113
#' @name aes_eval
111114
#'

0 commit comments

Comments
 (0)