← Back to all sparks
G

gratia

ANALYTICS
Velocity0.0

R package gratia by gavinsimpson — release notes from GitHub.

The tidy front-end for GAMs, now stable enough that upstream ggplot2 sets its release calendar.

gammgcvggplot2statistical-graphicsmodel-diagnosticsr-package
Current state
gratia wraps mgcv-fitted generalized additive models in tidy data frames and ggplot2 graphics — smooth_estimates(), fitted_values(), derivatives(), draw() and appraise() cover evaluation, prediction and diagnostics. The API reached its intended shape at 0.9.0, when every generated column was renamed to a dot-prefixed form, and 0.10.0 added conditional_values() for covariate-conditional prediction plots.
Where it's heading
The package has moved through a long rewrite cycle and out the other side. Successive releases replaced evaluate_smooth() with smooth_estimates(), rebuilt draw() on top of it, then renamed the entire output vocabulary to avoid colliding with user variables. That work is finished; 0.11.1 is driven almost entirely by ggplot2 4.0.0 compatibility, with new mgcv family support for quantile residuals riding along. Development now tracks upstream breakage rather than internal redesign.
Prediction
Expect the next releases to continue absorbing ggplot2 4.x and mgcv changes, with incremental family coverage in quantile_residuals() as the visible new work. The entries give no signal on which mgcv families come next.

Recent moves

  1. 11mo ago

    ggplot2 4.0.0 compatibility, plus four more quantile-residual families

    Primarily a compatibility release for ggplot2 4.0.0, which forced a fix to residual histogram binning so the middle bin centres at zero. quantile_residuals() picks up mgcv's scat, nb, betar and tw families, and partial_derivatives() now handles multiple smooths and skips random-effect and univariate terms instead of erroring.

    View source ↗
  2. 1y ago

    conditional_values() replaces vis.gam for conditional prediction plots

    conditional_values() lands as a tidy replacement for mgcv::vis.gam(), plotting predictions conditional on chosen covariates in the marginaleffects idiom. penalty() and basis() also gain reparameterization that exposes the penalty null space directly.

    View source ↗
  3. 2y ago

    parametric_effects() joins the dot-prefix rename; LSS families begin

    Catches parametric_effects() up to the 0.9.0 renaming, relabels random-effect plots by smooth label rather than variable name, and begins location-scale-shape family support in fitted_samples(). Cleanup work finishing what the previous release started.

    View source ↗
  4. 2y ago

    Every generated column gains a dot prefix

    ⚡ SPARK

    The release that fixed gratia's output vocabulary: every generated column across smooth_estimates(), fitted_values(), derivatives() and their siblings gained a dot prefix, and derivatives() switched to storing evaluation points under their real variable names. It is the boundary every downstream script written against gratia has to cross.

    View source ↗
  5. 3y ago

    Real variable names in smooth_samples(), plus dplyr 1.1.0 fixes

    Absorbs dplyr 1.1.0 changes and fixes smooth_samples() to return real variable names instead of .x1, .x2 placeholders — a precursor to the wholesale renaming at 0.9.0. draw.gam() also learns tensor products with a marginal random-effect smooth.

    View source ↗
  6. 4y ago

    M1 example output fixes and confint tibble returns

    A patch release driven by example output differing on M1 Macs, with confint methods returning tibbles and smooth plots relabelled to "Partial effect". Reference-output housekeeping rather than capability.

    View source ↗