Skip to content

Documentation clarifying stat_density/after_stat n #4832

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

Merged
merged 1 commit into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions R/aes-evaluation.r
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
#' `after_stat()` replaces the old approaches of using either `stat()` or
#' surrounding the variable names with `..`.
#'
#' @note Evaluation after stat transformation will only have access to the
#' variables calculated by the stat. Evaluation after scaling will only have
#' access to the final aesthetics of the layer (including non-mapped, default
#' aesthetics). The original layer data can only be accessed at the first stage.
#' @note Evaluation after stat transformation will have access to the
#' variables calculated by the stat, not the original mapped values. Evaluation
#' after scaling will only have access to the final aesthetics of the layer
#' (including non-mapped, default aesthetics). The original layer data can only
#' be accessed at the first stage.
#'
#' @param x An aesthetic expression using variables calculated by the stat
#' (`after_stat()`) or layer aesthetics (`after_scale()`).
Expand Down
1 change: 1 addition & 0 deletions R/stat-density.r
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#' \item{count}{density * number of points - useful for stacked density
#' plots}
#' \item{scaled}{density estimate, scaled to maximum of 1}
#' \item{n}{number of points}
#' \item{ndensity}{alias for `scaled`, to mirror the syntax of
#' [`stat_bin()`]}
#' }
Expand Down
9 changes: 5 additions & 4 deletions man/aes_eval.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/geom_density.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.