resample_uniform
draws a random (sub)sample
(with or without replacement) from the samples in data
.
resample_uniform(data, param = list(n = Inf, replace = FALSE))
data | a |
---|---|
param | a list with the following components: |
a data.frame
containing a subset of the rows of data
.
If param$replace=FALSE
, a subsample of size
min(param$n,nrow(data))
will be drawn from data
.
If param$replace=TRUE
, the size of the subsample is param$n
.
resample_strat_uniform()
, sample()
data(ecuador) # Muenchow et al. (2012), see ?ecuador d <- resample_uniform(ecuador, param = list(strat = 'slides', n = 200)) nrow(d) # == 200#> [1] 200sum(d$slides == 'TRUE')#> [1] 139