approxfun2: Bilinear interpolation function of data on a regular grid

Description Usage Arguments Value Author(s) See Also Examples

View source: R/approxfun2.R

Description

Generates a fast function f(x,y) that interpolates regularly gridded data, based on the equivalent subroutine approxfun in 1D.

Usage

1
approxfun2(x, y, z, outside = NA)

Arguments

x

vector of x-coordinates; must be strictly monotonically increasing, but not necessarily equally spaced

y

vector of y-coordinates; must be strictly monotonically increasing, but not necessarily equally spaced

z

matrix of dimension c(length(x),length(y)) containing the function values to be interpolated

outside

value of the approximation function outside the grid (default is NA)

Value

Returns a fast an vectorized interpolation function f(x,y)

Author(s)

Danail Obreschkow

See Also

approxfun

Examples

1
2
3
4
5
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))

physx documentation built on Feb. 3, 2022, 5:08 p.m.

Related to approxfun2 in physx...