data(meuse.riv)
meuse.sr = SpatialPolygons(list(Polygons(list(Polygon(meuse.riv)), "x")))
plot(meuse.sr)
points(spsample(meuse.sr, n = 1000, "regular"), pch = 3)
plot(meuse.sr)
points(spsample(meuse.sr, n = 1000, "random"), pch = 3)
plot(meuse.sr)
points(spsample(meuse.sr, n = 1000, "stratified"), pch = 3)
plot(meuse.sr)
points(spsample(meuse.sr, n = 1000, "nonaligned"), pch = 3)
plot(meuse.sr)
points(spsample(meuse.sr@polygons[[1]], n = 100, "stratified"), pch = 3, cex=.5)
data(meuse.grid)
gridded(meuse.grid) = ~x+y
image(meuse.grid)
points(spsample(meuse.grid,n=1000,type="random"), pch=3, cex=.5)
image(meuse.grid)
points(spsample(meuse.grid,n=1000,type="stratified"), pch=3, cex=.5)
image(meuse.grid)
points(spsample(meuse.grid,n=1000,type="regular"), pch=3, cex=.5)
image(meuse.grid)
points(spsample(meuse.grid,n=1000,type="nonaligned"), pch=3, cex=.5)
fullgrid(meuse.grid) = TRUE
image(meuse.grid)
points(spsample(meuse.grid,n=1000,type="stratified"), pch=3,cex=.5)
Run the code above in your browser using DataLab