Learn R Programming

spcosa (version 0.2-2)

stratify-methods: Stratification

Description

Methods for partitioning a spatial object into compact strata by means of $$k$$-means. The objective function to minimize is the mean squared shortest distance (MSSD). Optionally, the strata may be forced to be of equal size. This facilitates field work in case of stratified simple random sampling for composites. Another option is spatial infill sampling, a variant of spatial coverage sampling where existing sampling points are taken into account. Use nTry > 1, to reduce the risk of ending up in an unfavorable local optimum.

Usage

## S3 method for class 'SpatialPixels':
stratify(object, nStrata, priorPoints = NULL, maxIterations = 1000, nTry = 1,
    equalArea = FALSE, verbose = getOption("verbose"))
## S3 method for class 'SpatialPolygons':
stratify(object, nStrata, priorPoints = NULL, maxIterations = 1000, nTry = 1,
    nGridCells = 2500, equalArea = FALSE, verbose = getOption("verbose"))

Arguments

object
an object of class "SpatialPixels" or "SpatialPolygons"
nStrata
number of strata (nStrata >= 1).
priorPoints
object of class "SpatialPoints", containing the prior (i.e., existing) points
maxIterations
maximum number of iterations.
nTry
the stratify method will try nTry initial configurations and will keep the best solution in order to reduce the risk of ending up with an unfavorable solution.
nGridCells
in case object is an instance of class "SpatialPolygons", the approximate number of grid cells to be used for discretizing the vector map in object.
equalArea
If FALSE the algorithm results in compact strata. If TRUE, the algorithm results in compact strata of equal size.
verbose
if TRUE, progress information and intermediate results will be printed to the output device.

References

Brus, D. J., Spatjens, L. E. E. M., and de Gruijter, J. J. (1999). A sampling scheme for estimating the mean extractable phosphorus concentration of fields for environmental regulation. Geoderma 89:129-148 de Gruijter, J. J., Brus, D. J., Bierkens, M. F. P., and Knotters, M. (2006) Sampling for Natural Resource Monitoring Berlin: Springer-Verlag. Walvoort, D., Brus, D. and de Gruijter, J. (2009). Spatial Coverage Sampling on Various Spatial Scales. Pedometron 26:20-22 Walvoort, D. J. J., Brus, D. J. and de Gruijter, J. J. (2010). An R package for spatial coverage sampling and random sampling from compact geographical strata by $$k$$-means. Accepted for publication in Computers & Geosciences

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)

# plot the resulting stratification
plot(myStratification)

Run the code above in your browser using DataLab