sdraw: Sample draws from spatial objects.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/sdraw.r

Description

Draw samples (point locations) from SpatialPoints, SpatialLines, SpatialPolygons, and the *DataFrame varieties of each.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S3 method for class 'SpatialLines'
sdraw(x, n, type, ...)

## S3 method for class 'SpatialPoints'
sdraw(x, n, type, ...)

## S3 method for class 'SpatialPolygons'
sdraw(x, n, type, ...)

sdraw(x, n, type = "BAS", ...)

Arguments

x

A spatial object. Methods are implemented for SpatialPoints, SpatialPoints DataFrame, SpatialLines, SpatialLinesDataFrame, SpatialPolygons, and Spatial PolygonsDataFrame objects.

n

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).

type

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.

Details

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.

Value

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.

Author(s)

Trent McDonald

References

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.

See Also

bas.polygon, bas.line, bas.point, hip.polygon, hip.point, sss.polygon, sss.line, sss.point, grts.polygon, grts.line, grts.point

Examples

1
2
3
4
5
6
7
 ## 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))
 
## End(Not run)
 

Example output

Loading required package: sp
SDraw - Sample Draws (v 2.1.13)

SDraw documentation built on July 8, 2020, 6:23 p.m.