Compute expected hits from a size measure, or extract them from a with-replacement design object.
Usage
expected_hits(x, ...)
# Default S3 method
expected_hits(x, n, ...)
# S3 method for class 'wr'
expected_hits(x, ...)
# S3 method for class 'wor'
expected_hits(x, ...)See also
inclusion_prob() for the without-replacement analogue,
unequal_prob_wr() for sampling with expected hits.
Examples
# From size measures
x <- c(40, 80, 50, 60, 70)
hits <- expected_hits(x, n = 3)
sum(hits) # 3
#> [1] 3
# From a design object
s <- unequal_prob_wr(hits, method = "chromy")
expected_hits(s)
#> [1] 0.4 0.8 0.5 0.6 0.7