I have a grid of (x, y, z) values and I want a function that can approximate z-values when it is given (x,y) points that lie beyond the grid.
I have tried to solve the q
Got a result by using interp.old() directly:
interp.old(xy[,1], xy[,2], zz, xo = c(0.7), yo= c(0.7, 1.2), ncp=2, extrap=TRUE)
# = (0.9211469, 1.472434)
I am not sure if this is a bug in the interp() function. interp() is a wrapper that calls interp.old() if linear=TRUE and interp.new() if linear=FALSE. The interp.new() function seems to fail.
Note that the use of the ncp parameter is deprecated. From the manual:
ncp - deprecated, use parameter linear. Now only used by interp.old(). meaning was: number of additional points to be used in computing partial derivatives at each data point. ncp must be either 0 (partial derivatives are not used), or at least 2 but smaller than the number of data points (and smaller than 25)