Stats

Binning

  • stat-bin - Bin statistic: partition x into uniform-width bins, count rows per bin.
  • stat-bin-2d - Two-dimensional bin statistic: partition (x, y) into a rectangular grid and count rows per cell.
  • stat-bin-hex - Two-dimensional hexagonal bin statistic: partition (x, y) into a pointy-top hex grid and count rows per cell.
  • stat-bindot - Dot-density bin statistic: emit one stacked row per observation.

Distributions

  • stat-boxplot - Boxplot statistic: per-x five-number summary with outlier list.
  • stat-contour - Marching-squares contour statistic.
  • stat-contour-filled - Filled iso-band statistic. Partitions the (x, y, z) field into bands defined by successive levels and emits one closed polygon per cell that touches each band. Pair with geom-polygon or geom-contour-filled.
  • stat-ecdf - ECDF statistic: one row per unique x value with the cumulative fraction.
  • stat-ellipse - Covariance-ellipse statistic: one ellipse per group from the sample covariance of (x, y).
  • stat-qq - Q-Q statistic: theoretical-vs-sample pairs against a reference distribution.
  • stat-qq-line - Q-Q reference-line statistic: two endpoints of the IQR-fitted line.

Functions and helpers

  • stat-align - Align statistic: resample each group onto a shared x-grid.
  • stat-connect - Connection statistic: expand consecutive points with intermediate vertices.
  • stat-function - Sample fun at n points across xlim and emit (x, y) rows.
  • stat-identity - Identity statistic: returns data and mapping unchanged.
  • stat-manual - Manual statistic: run a closure on the data array inside the layer.

Smoothing and regression

  • stat-quantile - Quantile regression statistic: fit one line per τ and sample it.
  • stat-smooth - Smoother statistic: closed-form linear fit with a pointwise confidence band.

Summaries

  • stat-count - Count statistic: one output row per distinct x level with y = count.
  • stat-sum - Sum statistic: one output row per unique (x, y) pair with _n and _prop.
  • stat-summary - Per-axis reduction to a central value and an uncertainty band.
  • stat-summary-2d - Two-dimensional summary statistic.
  • stat-summary-bin - Summary statistic over uniform x bins.
  • stat-summary-hex - Hex-grid summary statistic.
  • stat-unique - Unique statistic: keep the first row per (x, y) key, drop later duplicates.
Back to top