R/sampling.R
morie_simple_random_sample.Rd
Simple random sample from a data frame
morie_simple_random_sample(df, n, replace = FALSE, seed = 42L)
A data frame.
Number of units to select.
Sample with replacement? Default FALSE.
FALSE
Random seed for reproducibility.
A data frame of n sampled rows with a .weight column added.
n
.weight
df <- data.frame(x = 1:100) srs_sample <- morie_simple_random_sample(df, 20)