
Add fitted values from a model to a data frame
Source:R/add-methods.R, R/gamm4-methods.R, R/scam-methods.R
add_fitted.RdAdd fitted values from a model to a data frame
Usage
add_fitted(data, model, value = ".value", ...)
# S3 method for class 'gamm4'
add_fitted(data, model, ...)
# S3 method for class 'scam'
add_fitted(data, model, ...)Arguments
- data
a data frame containing values for the variables used to fit the model. Passed to
stats::predict()asnewdata.- model
a fitted model for which a
stats::predict()method is available. S3 method dispatch is performed on themodelargument.- value
character; the name of the variable in which model predictions will be stored.
- ...
additional arguments passed to methods.