Skip to content

Commit 061cec2

Browse files
authored
Addresses #4476 clarifying that n is a computed value of stat_density() that can is not available as original mapping in after_stat. (#4832)
1 parent c9e6304 commit 061cec2

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

R/aes-evaluation.r

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@
2323
#' `after_stat()` replaces the old approaches of using either `stat()` or
2424
#' surrounding the variable names with `..`.
2525
#'
26-
#' @note Evaluation after stat transformation will only have access to the
27-
#' variables calculated by the stat. Evaluation after scaling will only have
28-
#' access to the final aesthetics of the layer (including non-mapped, default
29-
#' aesthetics). The original layer data can only be accessed at the first stage.
26+
#' @note Evaluation after stat transformation will have access to the
27+
#' variables calculated by the stat, not the original mapped values. Evaluation
28+
#' after scaling will only have access to the final aesthetics of the layer
29+
#' (including non-mapped, default aesthetics). The original layer data can only
30+
#' be accessed at the first stage.
3031
#'
3132
#' @param x An aesthetic expression using variables calculated by the stat
3233
#' (`after_stat()`) or layer aesthetics (`after_scale()`).

R/stat-density.r

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#' \item{count}{density * number of points - useful for stacked density
2222
#' plots}
2323
#' \item{scaled}{density estimate, scaled to maximum of 1}
24+
#' \item{n}{number of points}
2425
#' \item{ndensity}{alias for `scaled`, to mirror the syntax of
2526
#' [`stat_bin()`]}
2627
#' }

man/aes_eval.Rd

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

man/geom_density.Rd

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

0 commit comments

Comments
 (0)