[R] akima interpolation and triangulation question

From: steven wilson <swpt07_at_gmail.com>
Date: Thu, 29 May 2008 00:03:19 -0400


Dear all;

First of all, this is probably a more conceptual question than a R-related one, but still want to give it a try. When working with the interpolation function "interp" from the package akima and the triangulation function "tri.mesh" from package tripack I've got NA's for the interpolation and "error" for the triangulation. The data is arranged in a regular grid as opposed to what the help page for interp says but I think this is an interesting problem because I found this code on the web as part of an stats course (and it is not the only example I found). Because I'm not really into the details of the functions I would like to hear comments from people who have used these functions before.

This is the code

library(akima)
library(fields)
library(tripack)

soil <- read.table("http://www.unc.edu/~zhuz/teaching/Stat890/Data/soil.txt",header=TRUE) attach(soil)
soil.interp <- interp(u, v, moist) # linear interpolation works plot.surface(soil.interp)

# spline interpolation

soil.interp2 <- interp(u, v, moist, linear = F) # spline interpolation returns only NA's

# triangulation

tri.mesh(soil$u, soil$v) # got error

Thanks



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. Received on Thu 29 May 2008 - 07:15:52 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 Thu 29 May 2008 - 11:30:44 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.

list of date sections of archive