powered by
Generates a fast function f(x,y) that interpolates regularly gridded data, based on the equivalent subroutine approxfun in 1D.
approxfun
approxfun2(x, y, z, outside = NA)
vector of x-coordinates; must be strictly monotonically increasing, but not necessarily equally spaced
vector of y-coordinates; must be strictly monotonically increasing, but not necessarily equally spaced
matrix of dimension c(length(x),length(y)) containing the function values to be interpolated
value of the approximation function outside the grid (default is NA)
Returns a fast an vectorized interpolation function f(x,y)
# NOT RUN { x = seq(3) y = seq(4) z = array(c(x+1,x+2,x+3,x+4),c(3,4)) f = approxfun2(x,y,z) print(f(1.7,2.4)) # }
Run the code above in your browser using DataLab