resample_factor
draws a random (sub)sample
(with or without replacement) of the groups or clusters identified by
the fac
argument.
resample_factor(data, param = list(fac = "class", 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
min(param$n,nlevel(data[,fac]))
groups will be drawn from data
.
If param$replace=TRUE
, the number of groups to be drawn is param$n
.
resample_strat_uniform()
, sample()