[R] bivariate linear interpolation

Andrew Robinson A.Robinson at ms.unimelb.edu.au
Thu May 5 07:31:04 CEST 2011


The one that gives results that you trust and uses algorithms that you
understand!

Cheers

Andrew

On Wed, May 04, 2011 at 12:52:03PM +0000, Halldór Björnsson wrote:
> Hi,
> 
> I have three matrices (X,Y,P) with the same dimension. The X,Y grid is
> regular and I want to
> perform linear interpolation to pick out certain points. In matlab
> appropriate call is
> something like
> 
> Pout=interp2(X,Y,P,Xout,Yout, method="linear")
> 
> where Xout and Yout are the locations where I want the Pout data
> (typically a different grid).
> (Scipy has this routine in interpolate.interp2d, with similar arguments)
> 
> 
> In R there is (as often) the choice between many different
> interpolation routines. Akima has one for irregularly spaced
> data (and does not like co-linearity in the data). Fields has another
> one, with a more complicated arguments.
> 
> What is the best R function that accomplishes this?
> 
> Sincerely
> Halldór
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Andrew Robinson  
Program Manager, ACERA 
Department of Mathematics and Statistics            Tel: +61-3-8344-6410
University of Melbourne, VIC 3010 Australia               (prefer email)
http://www.ms.unimelb.edu.au/~andrewpr              Fax: +61-3-8344-4599
http://www.acera.unimelb.edu.au/

Forest Analytics with R (Springer, 2011) 
http://www.ms.unimelb.edu.au/FAwR/
Introduction to Scientific Programming and Simulation using R (CRC, 2009): 
http://www.ms.unimelb.edu.au/spuRs/



More information about the R-help mailing list