step_spline_b | R Documentation |
generates basis splines.
step_spline_b(
.rec,
terms,
df = 0L,
internal_knots = NULL,
boundary_knots = NULL,
intercept = FALSE,
periodic = FALSE,
degree = 3L,
role = "predictor",
...
)
.rec |
the R6 recipe object. |
terms |
the unquoted names of the variables to use or a selector function. terms replaces the '...' of the recipes package but requires variables to be included within 'c()'. For example to include variables x and y you would write 'c(x,y)' in the hydrorecipes package. |
df |
Degree of freedom that equals to the column number of the returned
matrix. One can specify |
internal_knots |
equivalent to knots from 'splines2::bSplines' |
boundary_knots |
equivalent to Boundary.knots from 'splines2::bSplines' |
intercept |
If |
periodic |
A logical value. If |
degree |
A nonnegative integer specifying the degree of the piecewise
polynomial. The default value is |
role |
character - the name of the role |
... |
Optional arguments that are not used. |
an updated recipe
formula <- as.formula(x~y+z)
rows <- 1e5
dat <- data.frame(x = rnorm(rows),
y = 1:rows,
z = cumsum(rnorm(rows)))
ik <- collapse::fquantile(dat$x, probs = seq(0, 1, 0.1))
bk <- ik[c(1, length(ik))]
ik <- ik[-c(1, length(ik))]
frec = recipe(formula = formula, data = dat) |>
step_spline_b(x, df = 11L, intercept = FALSE) |>
plate("tbl")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.