Learn R Programming

spcosa (version 0.2-2)

spsample-methods: Spatial Sampling of Compact Strata

Description

Methods for sampling in compact strata.

Arguments

See Also

spsample for other types of spatial sampling.

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