Usage
spsample(x, n, type, ...)
sample.Spatial(x, n, type, bb = bbox(x), offset = runif(nrow(bb)), cellsize, ...)
sample.Line(x, n, type, offset = runif(1), proj4string=CRS(as.character(NA)), ...)
sample.Polygon(x, n, type = "random", bb = bbox(x), offset = runif(2), proj4string=CRS(as.character(NA)), iter = 4, ...)
sample.Polygons(x, n, type = "random", bb = bbox(x), offset = runif(2), proj4string=CRS(as.character(NA)), iter = 4, ...)
sample.Sgrid(x, n, type = "random", bb = bbox(x), offset = runif(nrow(bb)), ...)
makegrid(x, n = 10000, nsig = 2, cellsize, offset = rep(0.5, nrow(bb)))
Arguments
x
Spatial object; spsample(x,...)
is a generic method for the
existing sample.Xxx
fumctions
...
optional arguments, passed to the appropriate sample.Xxx
functions
n
(approximate) sample size
type
character; "random"
for completely spatial random;
"regular"
for regular (systematically aligned) sampling;
"stratified"
for stratified random (one single random location in
each "cell"); "nonaligned"
fo
bb
bounding box of the sampled domain; setting this to a smaller
value leads to sub-region sampling
offset
for regular sampling only: the offset (position) of the regular
grid; the default for spsample
methods is a random location in
the unit cell $[0,1] [0,1]$, leading to a different grid after
each call; if this is set to c(0.5,0.5)