[R-sig-Geo] stratified random sampling

Dylan Beaudette debeaudette at ucdavis.edu
Mon Feb 23 19:59:01 CET 2009


On Monday 23 February 2009, Heuvelink, Gerard wrote:
> Dear list,
>
> I use readShapePoly to import a shape file. The file has multiple polygons
> (actually, a 'polygon' may consist of multiple polygons that have the same
> ID). I want to sample one location at random from each of the polygons. I
> tried to do this with spsample but did not manage (the option "stratified"
> does not do what I want). I also looked at dotsInPolys but also without
> success.
>
> I think it should be possible with spsample, possibly after first creating
> a large number of SpatialPolygons objects, one for each polygon, and next
> sampling one location at random from each of these. Unfortunately I am not
> very experienced and also failed to achieve what I want in this way.
>
> Can you help me?
>
> Thanks, Gerard Heuvelink
>

Does this help:
http://casoilresource.lawr.ucdavis.edu/drupal/node/644

Cheers,

Dylan


-- 
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341



More information about the R-sig-Geo mailing list