| setup.spline | R Documentation |
setup.spline takes a dataset and spline specification as input, and returns the
dataset with spline bases added.
setup.spline(spline, data, ...)
spline |
character vector of length 1, describing the spline basis to be created.
Currently, functions |
data |
a |
... |
additional arguments to be passed to the function specified in |
a data.frame with a many rows and columns as data. The spline
consists of df basis functions, but is contained in a single column named
spline, followed by the name of the predictor variable specified.
plot.splinetree predict.splinetree
lmertree glmertree
data <- setup.spline("ns(PAR, df = 3)", data = eco)
head(data)
matplot(x = data$PAR[order(data$PAR)],
y = data$spline.PAR[order(data$PAR),], type = "l")
data <- setup.spline("bs(PAR, degree = 2, df = 4)", data = eco)
head(data)
matplot(x = data$PAR[order(data$PAR)],
y = data$spline.PAR[order(data$PAR),], type = "l")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.