[R] nearest neighbour interpolation

Jari Oksanen jarioksa at sun3.oulu.fi
Fri Jan 31 12:17:03 CET 2003


On Fri, 2003-01-31 at 12:47, Roger Bivand wrote:
> On Thu, 30 Jan 2003, Matthew Oliver wrote:
> 
> > Dear Help List,
> > 
> > My name is Matt Oliver. I have been using R for about a year and find it very 
> > helpful. However, I have a need for a function that I cannot find. I am not very 
> > good at programming so I thought I would ask the group.
> > 
> Maybe this is an opportunity to explore things - they are usually feasible
> if the motivation is sufficiently strong.
> 
> > I have an irregular grid of data (x = Longitude, y = Latitude). Each pair of my x,y 
> > has a categorical value. Obviously linear or any other numerically based 
> > interpolation on categorical data does not make sense, so I want to use a nearest 
> > neighbor interpolation so that I can extrapolate my irregular grid to a regular grid 
> > of Longitude and Latitude.
> > 
> There does not seem to be such a function at present. 

I am not sure if this is an answer to the original question, but package
akima does the following:

Description: Linear or cubic spline interpolation for irregular
        gridded data

which sounds like something that was asked for.

cheers, jari oksanen
-- 
Jari Oksanen -- Dept Biology, Univ Oulu, 90014 Oulu, Finland
Ph. +358 8 5531526, cell +358 40 5136529, fax +358 8 5531061
email jari.oksanen at oulu.fi, homepage http://cc.oulu.fi/~jarioksa/




More information about the R-help mailing list