[R-sig-Geo] how to construct a variogram map

Edzer Pebesma edzer.pebesma at uni-muenster.de
Mon Apr 14 21:42:55 CEST 2014



On 04/11/2014 03:14 PM, Alessandra Carioli wrote:
> Dear All,
> 
> I am trying to construct a variogram map from a SptialPolygonsDataFrame. I am not sure where to start as I would need a SpatialPoints and not Polygons. Is there a way to coerce it into points? I have tried as.SpatialPoints.ppp and as.SpatialPointsDataFrame but neither works (I have my matrix of coordinates `coords`).
> 
> Bests,
> 
> Ale


It depends whether your polygons represent a constant property
throughout the polygons, e.g. like soil or geology maps do, or aggregate
properties over an area, such as population over administrative regions.

In the former case, you could use spsample to sample points within the
polygons; in the second case you may want to assign the attribute values
to polygon centroids, e.g. if your object is called pol, by

SpatialPointsDataFrame(coordinates(pol), as.data.frame(pol))

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Heisenbergstraße 2, 48149 Münster, Germany. Phone: +49 251
83 33081 http://ifgi.uni-muenster.de GPG key ID 0xAC227795



More information about the R-sig-Geo mailing list