Learn R Programming

splines2 (version 0.5.1)

plot.splines2: Visualize Spline Basis Functions

Description

Plot spline basis functions by lines in different colors.

Usage

# S3 method for splines2
plot(
  x,
  y,
  from = NULL,
  to = NULL,
  n = 101,
  mark_knots = c("none", "internal", "boundary", "all"),
  ...
)

Arguments

x

A splines2 object.

y

An argument that is not used.

from, to

Two numbers representing the start and end point for the plot, respectively.

n

An integer, the number of x values at which to evaluate.

mark_knots

A character vector specifying if knot placement should be indicated by vertical lines.

...

Additional arguments (other than x and y) that would be passed to matplot().

Details

This function is intended to quickly visualize the spline basis functions.