plot.hero_bspline {hero}R Documentation

Plot a hero_bspline object

Description

Plots basis functions specified by results of bspline.

Usage

## S3 method for class 'hero_bspline'
plot(x, nderiv = 0L, type = "l", kcol = NULL, ...)

Arguments

x

An object of class hero_bspline to be plotted.

nderiv

An integer value specifying the derivative order of the B-splines. The default is 0.

type

character string (length 1 vector) or vector of 1-character strings indicating the type of plot for each column of y, see plot for all possible types. The first character of type defines the first plot, the second character the second, etc. Characters in type are cycled through; e.g., "pl" alternately plots points and lines.

kcol

Color for vertical lines drawn at interior knots. Default is NULL, meaning no lines are drawn.

...

Additional graphical parameters passed to matplot function.

See Also

bspline

Examples

x = bspline(nbasis = 10, extend = FALSE)
plot(x)
plot(x, nderiv = 1)
plot(x, kcol = "grey") # plot vertical lines at knots

# extend knots passed rangeval
x2 = bspline(nbasis = 10, extend = TRUE)
plot(x2, kcol = "grey")

# compare to plot.fd
if (requireNamespace("fda", quietly = TRUE)) {
   x3 = fda::create.bspline.basis(nbasis = 10)
   par(mfrow = c(2, 1))
   plot(x, kcol = "grey")
   title("plot.hero_bspline")
}
plot(x3)
title("plot.fd")

[Package hero version 0.6 Index]