Expand description
ggplot2’s helper functions (#414): discretising a continuous variable
(cut_interval, cut_number, cut_width), resolution, and the
stat_summary summary functions (mean_se, mean_cl_normal,
mean_cl_boot, mean_sdl, median_hilow) as plain functions.
Structs§
- Cut
- A discretised variable: one interval label per input value (
Value::Nafor missing / non-finite input) and the interval labels in order — usevaluesas agroup/fillcolumn andlevelsfor the scale order. - CutWidth
- Options for
cut_width: at most one ofcenter/boundary, and which side of each interval is closed.
Functions§
- cut_
interval nintervals of equal width over the range ofx— ggplot2’scut_interval(x, n).- cut_
interval_ length - Intervals of width
lengthon a grid of multiples oflengthcoveringx— ggplot2’scut_interval(x, length = …). - cut_
number nintervals with (about) equal numbers of observations — ggplot2’scut_number(x, n)(R type-7 quantile breaks).- cut_
width - Intervals of width
width— ggplot2’scut_width(x, width, center, boundary, closed). - mean_
cl_ boot - Mean with a percentile-bootstrap interval from
bresamples (mean_cl_boot(x, conf.int, B); seeded, so reproducible — but not R’s random stream). - mean_
cl_ normal - Mean with a Student-t confidence interval (
mean_cl_normal(x, conf.int)). - mean_
sdl - Mean ±
multstandard deviations (mean_sdl(x, mult), default 2). - mean_se
(y, ymin, ymax)= mean ±multstandard errors (mean_se(x, mult)).- median_
hilow - Median with the outer
(1 ± conf_int) / 2sample quantiles (median_hilow(x, conf.int)). - resolution
- The smallest non-zero gap between the (unique) values of
x— ggplot2’sresolution(x, zero);zero = truealso counts the distance to 0. Constant data → 1.