Learn R Programming

SDraw (version 2.1.3)

sdraw: Sample draws from spatial objects.

Description

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

Usage

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

# S3 method for SpatialLines sdraw(x, n, type, ...)

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

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

Arguments

x

A spatial object. Methods are implemented for SpatialPoints, SpatialPointsDataFrame, SpatialLines, SpatialLinesDataFrame, SpatialPolygons, and SpatialPolygonsDataFrame 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:

  • "HAL" : HAlton Lattice sampling (Robertson et al., (Forthcoming))

  • "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

...

Optional arguments passed to underlying sample type method. See DETAILS.

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.

Details

This is a S4 generic method for types SpatialPoints*, SpatialLines*, and SpatialPolygons* objects.

HAL, BAS, GRTS, SRS 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 and eta parameters (which determine box sizes) are passed to hal.*. See documentation for hal.*, bas.*, sss.*, grts.*, and sss.* for the full list of parameters which determine sample characteristics.

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, hal.polygon, hal.line, hal.point, sss.polygon, sss.line, sss.point, grts.polygon, grts.line, grts.point

Examples

Run this code
# NOT RUN {
 WA.sample <- sdraw(WA, 100, "BAS")
 WA.sample <- sdraw(WA, 100, "HAL", J=c(6,4))
 WA.sample <- sdraw(WA, 100, "SSS", spacing=c(1,2))
 
# }

Run the code above in your browser using DataLab