sp (version 0.7-10)

spsample: sample point locations within a spatial region

Description

sample point locations within a square area, a ring, or on a spatial line, using regular or random sampling

Usage

spsample(x, n, type, ...)
sample.Spatial(x, n, type, bb = bbox(x), offset = runif(2), cellsize, ...)
sample.Sline(x, n, type, offset = runif(1), ...)
sample.Sring(x, n, type = "random", bb = bbox(x), offset = runif(2), ...)
sample.Srings(x, n, type = "random", bb = bbox(x), offset = runif(2), ...)
sample.Sgrid(x, n, type = "random", bb = bbox(x), offset = runif(2), ...)
makegrid(x, n = 10000, nsig = 2, cellsize, offset = c(0.5,0.5), 
	type = "regular", ...)

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"); or "nonaligned"
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)