add_residuals: Add residuals from a model to a data frame

add_residualsR Documentation

Add residuals from a model to a data frame

Description

Add residuals from a model to a data frame

Usage

add_residuals(data, model, value = ".residual", ...)

Arguments

data

a data frame containing values for the variables used to fit the model. Passed to stats::residuals() as newdata.

model

a fitted model for which a stats::residuals() method is available. S3 method dispatch is performed on the model argument.

value

character; the name of the variable in which model residuals will be stored.

...

additional arguments passed to methods.

Value

A data frame (tibble) formed from data and residuals from model.


gavinsimpson/gratia documentation built on April 13, 2024, 10:56 p.m.