Skip to content

Commit 495c7fa

Browse files
committed
explain procedure in details
1 parent b791310 commit 495c7fa

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

R/stat-chain.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@
1414
#' * The result of [`link_stat()`] to pass parameters or mapping instructions.
1515
#'
1616
#' @seealso [link_stat()]
17+
#' @details
18+
#' The procedure in which stats are chained are as follows. First, the
19+
#' layer-level, undelayed aesthetics in the `mapping` argument are evaluated.
20+
#' The data that results from that evaluation is passed to the first stat in
21+
#' the `stats` argument to perform that stat's computation. If that first stat
22+
#' is a [`link_stat`] with an `after.stat` component, the `after.stat` component
23+
#' is evaluated before passing on the data to the next stat in the `stats`
24+
#' argument. The next components in the `stats` argument work the same: the
25+
#' data is passed on to compute the stat, then `after.stat` is evaluated. In
26+
#' essence, the `after.stat` allows control over how computed variables are
27+
#' passed to the next stat in the chain. Finally, once all components in the
28+
#' `stats` arguments have been handled, the staged after stat components of
29+
#' the layer-level `mapping` is evaluated. Per usual, the data are then handled
30+
#' by the position and geom parts of a layer.
31+
#'
1732
#' @export
1833
#'
1934
#' @examples

man/stat_chain.Rd

Lines changed: 15 additions & 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)