An S4 Class to Represent a Piecewise Polynomial
Use length(object)
to get the number of piecewise ranges.
Use predict(object, newdata)
to evaluate at newdata
. Alternatively, use as.function(x)
to turn the piecewise polynomial into a function.
Use differentiate(x)
to take the derivative of each polynomial.
Use plot(x)
to lines{x}
to plot the piecewise polynomial.
leftBound
A vector that stores the left bounds of the piecewise ranges.
rightBound
A vector that stores the right bounds of the piecewise ranges.
polynomial
A list that stores the polynomials at each piecewise ranges.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.