[R] 2/3d interpolation from a regular grid to another regular grid

From: jiho <jo.irisson_at_gmail.com>
Date: Tue, 4 Dec 2007 16:55:40 +0100

Hello R users,

I have numerical data sampled on two grids, each one shifted by 0.5 from the other.

For example:

grid1 = expand.grid(x=0:3, y=0.5:2.5)
grid2 = expand.grid(x=0.5:2.5, y=0:3)
gridFinal = expand.grid(x=0.5:2.5, y=0.5:2.5)

plot(gridFinal, xlim=c(0,3), ylim=c(0,3), col="black", pch=19) points(grid1, xlim=c(0,3), ylim=c(0,3), col="red", pch=19) points(grid2, xlim=c(0,3), ylim=c(0,3), col="blue", pch=19)

I would like to interpolate the quantities on grid1 (red) and grid2 (blue) on the same grid (black). This scenario is very common in geophysical data and models. I only found:
- functions in package akima which are designed for irregular grids

Eventually, the same scenario will occur in 3D so if the function is 3D capable it would be a plus (but I am sure the solution to this is generic enough to work in nD)

Thank you in advance.



R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 04 Dec 2007 - 16:14:32 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 04 Dec 2007 - 21:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.