nested_partial_residuals {gratia}R Documentation

Partial residuals in nested form

Description

Computes partial residuals for smooth terms, formats them in long/tidy format, then nests the partial_residual column such that the result is a nested data frame with one row per smooth.

Usage

nested_partial_residuals(object, terms = NULL, data = NULL)

Arguments

object

a fitted GAM model

terms

a vector of terms to include partial residuals for. Passed to argument terms of mgcv::predict.gam()].

data

optional data frame

Value

A nested tibble (data frame) with one row per smooth term. Contains two columns:


[Package gratia version 0.9.2 Index]