Sample allocation type and count
Source:R/calculate_allocation_existing.R
calculate_allocation_existing.Rd
Determine how many samples to allocate within strata.
Usage
calculate_allocation_existing(
existing,
nSamp,
allocation = "prop",
weights = NULL,
metric = NULL,
force = FALSE
)
Arguments
- existing
sf 'POINT' or data.frame. Existing plot network.
- nSamp
Numeric. Number of desired samples.
- allocation
Character. Allocation algorithm to be used. Either
prop
(default) for proportional allocation,optim
for optimal allocation (equal sampling cost),equal
for equal number of samples (defined bynSamp
) for each strata, or"manual"
for user defined strata weights defined usingweights
.- weights
Numeric. Only applicable when
allocation = "manual"
. Vector of weights wheresum(weights) == 1
. Vector length must be equal to the number of unique strata where the first numeric value corresponds to stratum 1, second stratum 2 etc.- force
Logical.
Default = FALSE
- forcenSamp
to be exactly the user defined value in cases wherenSamp
andsraster
strata count are not equally divisible. Additional samples often need to be allocated or removed based on rounding differences resulting from proportional differences betweennSamp
and strata coverages insraster
. In these instances samples are either added to strata with the lowest number of samples or are removed from strata with the highest number of samples. Has no effect whenexisting
is provided.
Value
Returns a data.frame of:
strata - Strata ID.
total - Number of samples to be allocated. Values correspond to under representation (samples needed; positive value) or over representation (too many samples; negative value) based on the
nSamp
provided.need - Required samples per strata based on allocation method. Rounded.
References
Gregoire, T.G., & Valentine, H.T. (2007). Sampling Strategies for Natural Resources and the Environment (1st ed.). Chapman and Hall/CRC. https://doi.org/10.1201/9780203498880
See also
Other calculate functions:
calculate_allocation()
,
calculate_coobs()
,
calculate_distance()
,
calculate_pcomp()
,
calculate_pop()
,
calculate_representation()
,
calculate_sampsize()