Draw samples (point locations) from SpatialPoints
, SpatialLines
,
SpatialPolygons
, and the *DataFrame
varieties of each.
# S3 method for SpatialLines
sdraw(x, n, type, ...)# S3 method for SpatialPoints
sdraw(x, n, type, ...)
# S3 method for SpatialPolygons
sdraw(x, n, type, ...)
sdraw(x, n, type = "BAS", ...)
A spatial object. Methods are implemented for SpatialPoints
,
Spatial
Points
DataFrame
, SpatialLines
, Spatial
Lines
DataFrame
,
SpatialPolygons
, and
Spatial
Polygons
DataFrame
objects.
Desired sample size. Some type
's of samples are fixed-size (see DETAILS),
in which case
exactly n
points are returned. Other type
's are variable-size,
and this number is the expected sample size (i.e., average over many repetitions).
Character, naming the type of sample to draw. Valid type
's are:
"BAS"
: Balanced Acceptance Sampling (Robertson et al., 2013)
"SSS"
: Simple Systematic (grid) Sampling, with random start and orientation
"GRTS"
: Generalized Random Tessellation Stratified sampling
(Stevens and Olsen, 2004)
"SRS"
: Simple Random Sampling
"HIP"
: Halton Iterative Partitioning (Robertson et al., 2017)
Optional arguments passed to underlying sample type method. See DETAILS.
A SpatialPointsDataFrame
object. At a minimum, the data frame
embedded in the SpatialPoints
object contains a column named siteID
which
numbers the points, and geometryID
which contains the ID of the
spatial object from which the point was drawn.
If x
is a Spatial*DataFrame
, the return's data
frame contains all attributes of x
evaluated at the locations of the sample points.
Certain sampling routine add attributes
that are pertinent to the design. For example, the grts.*
routines add
a pointType
attribute. See documentation for the underlying sampling routine
to interpret extra output point attributes.
This is a S4 generic method for types SpatialPoints*
, SpatialLines*
,
and SpatialPolygons*
objects.
BAS, GRTS, SRS, HIP
are fixed-size designs (return exactly n
points).
The SSS
algorithm applied to Line and Point is fixed-sized. The SSS
method
applied to Polygon frames is variable-sized.
Options which determine characteristics of each
sample time are passed via ...
. For example,
spacing and "shape" of the grid in sss.*
are controlled via
spacing=
and triangular=
, while the
J
parameter (which determine box sizes)
is passed to hip.*
. See documentation for
hip.*
, bas.*
, sss.*
, grts.*
, and sss.*
for the full list of
parameters which determine sample characteristics.
Robertson, B.L., J. A. Brown, T. L. McDonald, and P. Jaksons (2013) "BAS: Balanced Acceptance Sampling of Natural Resources", Biometrics, v69, p. 776-784.
Stevens D. L. Jr. and A. R. Olsen (2004) "Spatially Balanced Sampling of Natural Resources", Journal of the American Statistical Association, v99, p. 262-278.
bas.polygon
, bas.line
, bas.point
,
hip.polygon
, hip.point
,
sss.polygon
, sss.line
, sss.point
,
grts.polygon
, grts.line
, grts.point
# NOT RUN {
# }
# NOT RUN {
WA.sample <- sdraw(WA, 50, "BAS")
WA.sample <- sdraw(WA, 50, "HIP", J=c(4,3))
WA.sample <- sdraw(WA, 50, "SSS", spacing=c(1,2))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab