Panel Function to Add a Spline Smooth
A predefined panel function that can be used to add a spline smooth based on the provided data.
panel.spline(x, y, npoints = 101, lwd = plot.line$lwd, lty = plot.line$lty, col, col.line = plot.line$col, type, horizontal = FALSE, …, keep.data = FALSE, identifier = "spline")
- x, y
Variables defining the data to be used.
The number of equally spaced points within the range of the predictor at which the fitted model is evaluated for plotting.
- lwd, lty, col, col.line
Graphical parameters for the added line.
Ignored. The argument is present only to make sure that an explicitly specified
typeargument (perhaps meant for another function) does not affect the display.
A logical flag controlling which variable is to be treated as the predictor (by default
x) and which as the response (by default
TRUE, the plot is ‘transposed’ in the sense that
ybecomes the predictor and
xthe response. (The name ‘horizontal’ may seem an odd choice for this argument, and originates from similar usage in
Passed on to
smooth.spline. The default here (
FALSE) is different, and results in the original data not being retained in the fitted spline model. It may be useful to set this to
TRUEif the return value of
panel.spline, which is the fitted model as returned by
smooth.spline, is to be used for subsequent computations.
A character string that is prepended to the names of grobs that are created by this panel function.
The fitted model as returned by