Skip to contents

Update the knot placement, polynomial degree, and any other options available when constructing the given spline object.

Usage

# S3 method for BSpline
update(object, ...)

# S3 method for MSpline
update(object, ...)

# S3 method for ISpline
update(object, ...)

# S3 method for CSpline
update(object, ...)

# S3 method for BernsteinPoly
update(object, ...)

# S3 method for NaturalSpline
update(object, ...)

# S3 method for NaturalSplineK
update(object, ...)

Arguments

object

Spline objects produced by the splines2 package.

...

Other arguments passed to the corresponing constructor function.

Value

An updated object of the same class as the input object with the specified updates.

Examples

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)