rsamp: Draws simple random sample without replacement

Description Usage Arguments Value References Examples

View source: R/rsamp.R

Description

Draws simple random sample without replacement

Usage

1
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)

Value

Returns simple random sample without replacement

References

Simplified wrapper around dplyr::sample_n()

Examples

1
2
3
4
rsamp(albania, n=360, over=0.1, rep=FALSE)

size <- rsampcalc(nrow(albania), 3, 95, 0.5)
randomsample <- rsamp(albania, size)

sampler documentation built on Sept. 15, 2019, 5:02 p.m.