View source: R/interpolators.R
iprPCHIP | R Documentation |
PCHIP interpolator. It is monotonic.
iprPCHIP(x, y)
x, y |
numeric vectors giving the coordinates of the known points, without missing value |
See PCHIP interpolation.
An interpolator, for usage in evalInterpolator
.
library(interpolators)
x <- seq(0, 4*pi, length.out = 9L)
y <- x - sin(x)
ipr <- iprPCHIP(x, y)
curve(x - sin(x), from = 0, to = 4*pi, lwd = 2)
curve(
evalInterpolator(ipr, x),
add = TRUE, col = "blue", lwd = 3, lty = "dashed"
)
points(x, y, pch = 19)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.