Learn R Programming

spcosa (version 0.3-0)

spsample-methods: Spatial Sampling of Compact Strata

Description

Methods for sampling in compact strata.

Arguments

See Also

stratify for stratification, spsample for other types of spatial sampling, and estimate for inference.

Examples

Run this code
# read a vector representation of the `Farmsum' field (by means of rgdal-package)
shpFarmsum <- readOGR(dsn = system.file("maps", package = "spcosa"), layer = "farmsum")

# stratify `Farmsum' into 50 strata
myStratification <- stratify(shpFarmsum, nStrata = 50)

# sample two sampling units per stratum
mySamplingPattern <- spsample(myStratification, n = 2)

# plot the resulting sampling pattern
plot(myStratification, mySamplingPattern)

Run the code above in your browser using DataLab