mean
Mean as a degenerate summary (y, ymin: y, ymax: y).
Useful as a callable building block when only a central value is needed, or as fun: "mean" to draw a plain point summary with no band.
Usage
mean(
values,
weights: none,
)Parameters
| Parameter | Default | Description |
|---|---|---|
values |
Array of numbers; non-numeric entries are dropped. | |
weights |
none |
Optional array of non-negative weights (none for unit weights). Pairs are dropped when the weight is none, zero, or negative. |
Returns
Dict (y, ymin, ymax) with ymin == ymax == y; all-none if values has no numerics.
Examples
Plain mean of a small sample.
#let s = mean((2, 3, 4, 5, 6))
// s.y == 4, s.ymin == 4, s.ymax == 4