Interpolation function
This function currently implements piecewise linear interpolation (=barycentric interpolation).
interp(x, y = NULL, z, xo = seq(min(x), max(x), length = nx), yo = seq(min(y), max(y), length = ny), linear = (method == "linear"), extrap = FALSE, duplicate = "error", dupfun = NULL, nx = 40, ny = 40, input="points", output = "grid", method = "linear", deltri = "shull")
x |
vector of x-coordinates of data points or a
|
y |
vector of y-coordinates of data points. Missing values are not accepted. If left as NULL indicates that |
z |
vector of z-values at data points or a character variable
naming the variable of interest in the
Missing values are not accepted.
|
xo |
If If |
yo |
If If |
input |
text, possible values are This is used to distinguish between regular and irregular gridded data. |
output |
text, possible values are If In the case of |
linear |
logical, only for backward compatibility with Please use the new |
method |
text, possible methods are (currently only, more is under
developement) This replaces the old |
extrap |
logical, indicates if extrapolation outside the convex hull is intended, will not work for piecewise linear interpolation! |
duplicate |
character string indicating how to handle duplicate data points. Possible values are
|
dupfun |
a function, applied to duplicate points if
|
nx |
dimension of output grid in x direction |
ny |
dimension of output grid in y direction |
deltri |
triangulation method used, this argument will later be moved
into a control set together with others related to the spline
interpolation! Possible values are |
a list with 3 components:
x,y |
If If |
z |
If If If the input was a |
Albrecht Gebhardt <albrecht.gebhardt@aau.at>, Roger Bivand <roger.bivand@nhh.no>
Moebius, A. F. (1827) Der barymetrische Calcul. Verlag v. Johann Ambrosius Barth, Leipzig, https://books.google.at/books?id=eFPluv_UqFEC&hl=de&pg=PR1#v=onepage&q&f=false
Franke, R., (1979). A critical comparison of some methods for interpolation of scattered data. Tech. Rep. NPS-53-79-003, Dept. of Mathematics, Naval Postgraduate School, Monterey, Calif.
### Use all datasets from Franke, 1979: data(franke) for(i in 1:5) for(j in 1:3){ FR <- franke.data(i,j,franke) IL <- with(FR, interp(x,y,z,method="linear")) image(IL) contour(IL,add=TRUE) with(FR,points(x,y)) }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.