Learn R Programming

SDraw (version 2.1.13)

grts.polygon: Draw a equi-probable GRTS sample from an area (polygon) resource.

Description

Draws an equi-probable unstratified Generalized Random Tessellation Stratified (GRTS) sample from a SpatialPolygons* object

Usage

grts.polygon(x, n, over.n = 0)

Arguments

x

A SpatialPolygons or SpatialPolygonsDataFrame object.

n

Sample size. The number of 'sample' points to draw from x

over.n

Over-sample size. The number of 'over-sample' points to draw from x. The actual number of points drawn from x is n + over.n.

Value

A SpatialPointsDataFrame containing locations in the GRTS sample, in order they are to be visited. Attributes of the sample points (in the embedded data frame) are as follows:

  • sampleID: Unique identifier for points in the sample. This encodes the GRTS ordering of the sample. The output object comes pre-sorted in GRTS order. If the sample becomes un-GRTS-ordered, resort by sampleID (i.e., samp <- samp[order(samp$sampleID),]).

  • pointType: A string identifying regular sample points (pointType=="Sample") and over-sample points (pointType=="OverSample").

  • geometryID: The ID of the polygon in x which each sample points fall. The ID of polygons in x are row.names(geometry(x)).

  • Any attributes of the original polygons (in x).

Additional attributes of the output object, beyond those which make it a SpatialPointsDataFrame, are:

  • frame: Name of the input sampling frame.

  • frame.type: Type of resource in sampling frame. (i.e., "polygon").

  • sample.type: Type of sample drawn. (i.e., "GRTS").

  • n: Regular sample size. (i.e., sum(out$pointType=="Sample"))

  • over.n: Over-sample size. (i.e., sum(out$pointType=="OverSample"))

Details

This is a wrapper for the grts function in package spsurvey. This simplifies calling grts when equi-probable samples are desired. It extends the allowable input frame types to SpatialPolygons objects (i.e., no attributes), rather than just SpatialPolygonsDataFrame objects. For more complicated designs (e.g., variable probability, stratification), call grts directly.

References

Stevens, D. L. and A. R. Olsen (1999). Spatially restricted surveys over time for aquatic resources. Journal of Agricultural, Biological, and Environmental Statistics 4 (4), 415-428.

Stevens, D. L. and A. R. Olsen (2004). Spatially balanced sampling of natural resources. Journal of the American Statistical Association 99, 262-278.

See Also

grts.line, grts.polygon, hip.polygon, bas.polygon, sdraw

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
## The following take > 5s to execute

#   Draw sample
WA.sample <- grts.polygon(WA,10,5)

#   Plot
plot( WA )

# Plot 'sample' locations
plot( WA.sample[ WA.sample$pointType == "Sample", ], pch=16, add=TRUE, col="red" )  

# Plot 'over sample' locations
plot( WA.sample[ WA.sample$pointType == "OverSample", ], pch=1, add=TRUE, col="blue" )  
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab