iprPCHIP {interpolators} | R Documentation |
PCHIP interpolator
Description
PCHIP interpolator. It is monotonic.
Usage
iprPCHIP(x, y)
Arguments
x , y |
numeric vectors giving the coordinates of the known points, without missing value |
Details
See PCHIP interpolation.
Value
An interpolator, for usage in evalInterpolator
.
Examples
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)
[Package interpolators version 1.0.1 Index]