rsamp function

Draws simple random sample without replacement

Draws simple random sample without replacement

rsamp(df, n, over = 0, rep = FALSE)

Arguments

  • df: object containing full sampling data frame (e.g. data)
  • n: sample size (integer) or object containing sample size
  • over: (optional) desired oversampling proportion (defaults to 0; takes value between 0 and 1 as input)
  • rep: (optional)

Returns

Returns simple random sample without replacement

Examples

rsamp(albania, n=360, over=0.1, rep=FALSE) size <- rsampcalc(nrow(albania), 3, 95, 0.5) randomsample <- rsamp(albania, size)

References

Simplified wrapper around dplyr::sample_n()

  • Maintainer: Michael Baldassaro
  • License: MIT + file LICENSE
  • Last published: 2019-09-15