Computes all possible samples from a given population using simple random sampling
srs(popvalues, n)
are values of the population. NA
s and Inf
s are allowed but will be removed from the population.
the sample size
The function srs()
returns a matrix containing the possible simple random samples of size n
taken from a population of finite values popvalues
.
If non-finite values are entered as part of the population, they are removed; and the returned simple random sample computed is based on the remaining finite values.
srs(popvalues = c(5, 8, 3, NA, Inf), n = 2)
#> [,1] [,2]
#> [1,] 5 8
#> [2,] 5 3
#> [3,] 8 3