Skip to content

how to construct a variogram map

2 messages · Alessandra Carioli, Edzer Pebesma

#
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
3 days later
#
On 04/11/2014 03:14 PM, Alessandra Carioli wrote:
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))