[R-sig-Geo] Question re: Intamap package / Interpolate method: Inputs NOT both Spatial Points Data Frame?

Edzer Pebesma edzer.pebesma at uni-muenster.de
Tue Oct 26 22:09:09 CEST 2010


Are you sure you loaded package intamap before trying this?

On 10/26/2010 09:05 PM, Rick Reeves wrote:
> Hello:
> 
> I note a conflict in the documentation for Intamap/interpolate(), 
> to know how to resolve:
> 
> I have two SpatalPointsDataFrame objects:
> 
>  growingDegreeObservations <- readShapePoints("OhioGDDStationsGP.shp") 
> # computed surface phenomena, for individual lat/lon points
>  OrgStaLocs <- readShapePoints("Org_Locations.shp")                    #
> species observation stations, for DIFFERENT lat/lon points
> 
> # Objective: Interpolate the growingDegree points into a SpatialGrid (?)
> raster field, and then
> # overlay the observation stations on to the field, and assign field
> values to each observation station points
> 
> # according to intamap documentation, the interpolate() method accepts
> two SptatialPointsDataFrame objects, interpolates
> # the first ($value field) into a grid, and assigns interpolated
> observations to the predicted locations (monarchStaLocs).
> 
> interpImage <- interpolate(growingDegreeObservations
> ,OrgStaLocs,list(mean=TRUE, variance=TRUE))
> 
> However, when this line is executed, the error occurs:
> 
> Error in function (classes, fdef, mtable)  :
>   unable to find an inherited method for function "interpolate", for
> signature "SpatialPointsDataFrame"
> 
> I guess that this refers to the first argument, and that the argument
> must be a SpatialPixels or SpatialGrid data frame.
> Questions:
> 
> 1) Do I understand the inputs and outputs of interpolate() correctly?
> 
> 2) How best to transform the incorrect (SpatialPointsDataFrame) argument
>      to match the required inputs? E.G., create the interpolated
> SpatialPixelsDataFrame
>      of observations before calling interpolate())
> 
> 3) Is there a better R technique (e.g., direct call to krige()) for
> computing my solution?
> 
> Thanks, Rick R
> 
> 
> 
> 
> 
> 
> 

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      e.pebesma at wwu.de



More information about the R-sig-Geo mailing list