[R] Interpolation Problems

Roger Bivand Roger.Bivand at nhh.no
Tue Sep 2 14:22:09 CEST 2008


Steve Murray <smurray444 <at> hotmail.com> writes:

> 
> 
> Thanks Duncan - a couple of extra points... I should have perhaps pointed 
> out that the data are on a *regular*
> 'box' grid (with each value currently spaced at 1 degree intervals). Also,  
> I'm looking for something
> fairly simple, like a bilinear interpolation (where each new point is 
> created based on the values of the
> four points surrounding it).
> 
> In answer to your question, JanAv is simply the data frame of values. 
> And yes, you're right, I think I'll need
> a 2D interpolation as it's a grid with latitude and longitude values 
> (which as an aside, I guess these need
> to be interpolated differently? In a 1D format??). I think you're also 
> right in that the 'akima' package
> isn't suitable for this job, as it's designed for irregular grids.

Yes, interp() is not intended to points on grid lines. My suggestion would 
be to review the Spatial task view on CRAN, and possibly to post to the 
R-sig-geo list. Note that the metric may need to be spherical if you are
close to the Poles. If you convert JanAv into a SpatialPointsDataFrame, with
an appropriate CRS("+proj=longlat") coordinate reference system, and
define a SpatialPixels object for the new grid, you may be able to use
idw() in gstat with a very limited search radius to do a simple interpolation
on the sphere.

Roger
> 
> Do you, or does anyone, have any suggestions as to what my best option 
> should be?
> 
> Thanks again,
> 
> Steve
>



More information about the R-help mailing list