Learn R Programming

splines2 (version 0.4.8)

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 bSpline2
update(object, ...)

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

# S3 method for ibs 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, ...)

Value

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

Arguments

object

Objects of class bSpline2, ibs, mSpline, iSpline, cSpline, bernsteinPoly or naturalSpline with attributes describing knots, degree, etc.

...

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