spsample-methods: Spatial Sampling of Compact Strata

Description Methods See Also Examples

Description

Methods for sampling in compact strata.

Methods

x = "CompactStratification", n = "missing", type = "missing"

samples the centroids of each stratum.

x = "CompactStratification", n = "numeric", type = "missing"

stratified simple random sampling with n samples per stratum.

x = "CompactStratificationEqualArea", n = "numeric", type = "character"

if type = "composite", stratified simple random sampling of n composites.

x = "CompactStratificationPriorPoints", n = "missing", type = "missing"

spatial infill sampling

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Note: the example below requires the 'rgdal'-package.
# You may consider the 'maptools'-package as an alternative
if (require(rgdal)) {

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

    # stratify `Farmsum' into 50 strata
    # NB: increase argument 'nTry' to get better results
    set.seed(314)
    myStratification <- stratify(shpFarmsum, nStrata = 50, nTry = 1)

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

    # plot the resulting sampling pattern on
    # top of the stratification
    plot(myStratification, mySamplingPattern)

}

spcosa documentation built on May 29, 2017, 10:16 p.m.