Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

interpolate

Interpolate Values of Array


Description

For each row in matrix x, the hypercube of a containing this point is searched. The corners of the hypercube are linearly interpolated. By default, dimnames(a) is taken to contain the coordinate values for each point in a. This can be overridden using adims. If method=="constant", the value of the “lower left” corner of the hypercube is returned.

Usage

interpolate(x, a, adims=lapply(dimnames(a), as.numeric),
            method="linear")

Arguments

x

Matrix of values at which interpolation shall take place.

a

Array of arbitrary dimension.

adims

List of the same structure as dimnames(a).

method

Interpolation method, one of "linear" or "constant".

Author(s)

Friedrich Leisch

See Also

Examples

x <- seq(0,3,0.2)
z <- outer(x,x, function(x,y) sin(x*y))
dimnames(z) <- list(x,x)
sin(1.1*2.1)
interpolate(c(1.1, 2.1),z)

e1071

Misc Functions of the Department of Statistics, Probability Theory Group (Formerly: E1071), TU Wien

v1.7-11
GPL-2 | GPL-3
Authors
David Meyer [aut, cre], Evgenia Dimitriadou [aut, cph], Kurt Hornik [aut], Andreas Weingessel [aut], Friedrich Leisch [aut], Chih-Chung Chang [ctb, cph] (libsvm C++-code), Chih-Chen Lin [ctb, cph] (libsvm C++-code)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.