Learn R Programming

splines2 (version 0.5.1)

update: Update Spline Basis Functions

Description

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, ...)

Value

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

Arguments

object

Spline objects produced by the splines2 package.

...

Other arguments passed to the corresponing constructor function.

Examples

Run this code
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)

Run the code above in your browser using DataLab