Re: [R] Calculate depth from regular xyz grid for any coordinate within the grid

2014-07-28 Thread Michael Sumner
The raster package can readily provide bilinear interpolation: library(raster) r <- rasterFromXY(df) ## due diligence, just a guess here you should check ## projection(r) <- "+proj=utm +zone=32 +datum=WGS84" ## coordinates to extract m <- matrix(c( 3454263, 5970687), ncol = 2) extract(r, m, meth

Re: [R] Calculate depth from regular xyz grid for any coordinate within the grid

2014-07-28 Thread MacQueen, Don
I believe the interpp() function from the akima package will do what you want. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 7/28/14, 6:07 AM, "Kulupp" wrote: >Dear R-experts, > >I have a regular grid dataframe (here

Re: [R] Calculate depth from regular xyz grid for any coordinate within the grid

2014-07-28 Thread Sarah Goslee
Hi, The area of statistics you're looking for is called geostatistics. There are many R packages to conduct such analyses. See the Spatial task view for some good starting points: http://cran.r-project.org/web/views/Spatial.html You'll need to do some homework to understand the various options a

[R] Calculate depth from regular xyz grid for any coordinate within the grid

2014-07-28 Thread Kulupp
Dear R-experts, I have a regular grid dataframe (here: the first 50 rows) : # data frame (regular grid) with x, y (UTM-coordinates) and z (depth) # x=UTM coordinates (easting, zone 32) # y=UTM coordinates (northing, zone 32) # z=river-depth (meters) df <- data.frame(x=c(3454240, 3454240, 3454240