Basis expansions for smooths
Creates a basis expansion from a definition of a smoother using the syntax
of mgcv's smooths via mgcv::s()
., mgcv::te()
, mgcv::ti()
, and
mgcv::t2()
.
basis(smooth, data, knots = NULL, constraints = FALSE, ...)
smooth |
a smooth specification, the result of a call to one of
|
data |
a data frame containing the variables used in |
knots |
a list or data frame with named components containing
knots locations. Names must match the covariates for which the basis
is required. See |
constraints |
logical; should identifiability constraints be applied to
the smooth basis. See argument |
... |
other arguments passed to |
A tibble.
Gavin L. Simpson
load_mgcv() df <- gamSim(4, n = 400, verbose = FALSE) bf <- basis(s(x0), data = df) bf <- basis(s(x2, by = fac, bs = 'bs'), data = df, constraints = TRUE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.