Takes a sample without replacement from the population. See the Details section below for further information.
Arguments
- N
positive integer value, the population size
- n
positive integer value, the sample size
- prob
(optional) N-length vector of positive numeric values, the probability weights for obtaining the
N
elements
Details
This function is a wrapper to the sample.int
function.
Examples
#Set seed for reproducibility
set.seed(seed = 5381L)
#Simple random sample without replacement
sampleWithoutReplacement(N = 10, n = 5)
#> [1] 1 9 7 2 4