update | R Documentation |
Update the knot placement, polynomial degree, and any other options available when constructing the given spline object.
## S3 method for class 'BSpline'
update(object, ...)
## S3 method for class 'MSpline'
update(object, ...)
## S3 method for class 'ISpline'
update(object, ...)
## S3 method for class 'CSpline'
update(object, ...)
## S3 method for class 'BernsteinPoly'
update(object, ...)
## S3 method for class 'NaturalSpline'
update(object, ...)
## S3 method for class 'NaturalSplineK'
update(object, ...)
object |
Spline objects produced by the |
... |
Other arguments passed to the corresponing constructor function. |
An updated object of the same class as the input object with the specified updates.
library(splines2)
x <- seq.int(0, 1, 0.01)
knots <- c(0.3, 0.5, 0.6)
## quadratic B-splines
bsMat2 <- bSpline(x, knots = knots, degree = 2, intercept = TRUE)
## cubic B-splines
bsMat3 <- update(bsMat2, degree = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.