Description Usage Arguments Details Value See Also Examples
View source: R/functions_utils.R
Wrapper function for creating a spline matrix
1 2 3 4 5 | create_spline(x, xrange = NULL, by = 1, df = 1, fn = "ns", ...)
create_spline_matrix(x, df = 1, fn = "ns", ...)
predict_spline(spline, newx, center = FALSE, scale = FALSE)
|
x |
Variable values for which spline is to be created. |
xrange |
Range (min and max) of values to use for creating spline. Only used if |
by |
Interval of generated sequence. |
df |
Degrees of freedom for spline. If set to 1, then a linear function assumed; otherwise |
fn |
Character string specifying the spline-generating function. Defaults to |
... |
additional arguments passed to |
spline |
Spline object from which to predict. |
newx |
New values for which splines should be generated |
center, scale |
Should spline values be centered and/or scaled? Default is |
Note that predict_spline
relies on the existence of a predict
generic for the class of spline.
For create_spline
, a list containing:
x
– the values provided in argument x
spline
– a matrix of spline values evaluated at x
spline_mean
– a vector of column-wise means of spline
For create_spline_matrix
, the matrix of spline values only.
For predict_spline
, a matrix of spline values evaluated at newx
.
add_spline_time
, sim_update_time_splines
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.