Internal functions for secondary sampling. Should not be directly; designed
for use in wt_strata.
Usage
ssu_fixed(weights, ssu, schema, reuse_weights = TRUE, ...)
ssu_fuzzy(weights, ssu, schema, reuse_weights = TRUE, ...)
ssu_ideal(weights, ssu, schema, ...)
ssu_relative(weights, ssu, schema, reuse_weights = TRUE, ...)Arguments
- weights
A weights raster according to
wt_stratacropped to the geometry of a primary sampling unit.- ssu
Character vector or factor representing the secondary sampling unit (SSU) according to
wt_strataof a single primary sampling unit.- schema
An SSU schema created by
ssu_schema. Seewt_strata.- reuse_weights
If
TRUEandssuis provided, uses the weights dataset defined in theweightsargument both for generating SSUs and as a weights raster forwt_sample. This would result in a double weighting where locations can only be sampled in certain regions ofweightsand within these regions have a certain probability to be sampled in a specific part of the region. IfFALSE, performs random sampling after SSU assignment. Defaults toTRUEto reduce randomness. Ignored ifssuis not provided.Set to
FALSEif performance is at a premium or if this behavior is not desired. For example, in high-value regions of a population raster, the probability of people living in regions with lower population densities is still very high and might not be properly represented by weighted sampling. Generally, if the assignment of sampling zones usingschemais already detailed and leaves little space within each zone, reusing weights can be superfluous.Only relevant if the schema is threshold-based, i.e., the argument is silently ignored if the schema is of type ideal.
- ...
Further arguments passed to
wt_sample.
Examples
# the use of secondary sampling functions is declared by defining schemas
ssu_schema(class1 = c(0, 10), class2 = c(10, 20), type = "fixed")
#> SSU schema using fixed thresholds
#> Points are only sampled within these thresholds.
#>
#> class1 = [0, 10)
#> class2 = [10, 20]
