Finds a piecewise linear function that interpolates the data points
a vector of x values
a vector of y values
pwiselinterp finds a piecewise linear function that
interpolates the data points. For each x-y ordered pair, there
function finds the unique line interpolating them. The function will
return a data.frame with three columns.
x is the upper bound of the domain for the given
piece. The columns
b represent the coefficients
from the y-intercept form of the linear equation, y = mx + b.
The matrix will contain length(x) rows with the first row having m and b of NA.
a matrix with the linear function components
1 2 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.