This function gets a design matrix for a generalized additive model (GAM) from the mgcv package or a linear model.

getDesign(form, data)

Arguments

form

A formula or string beginning with ~ that can be interpreted as an mgcv or lm formula without the outcome variable.

data

A data frame containing the variables specified in form.

Value

Returns a design matrix constructed from form and data.