resample_factor {sperrorest} | R Documentation |
Draw uniform random (sub)sample at the group level
Description
resample_factor
draws a random (sub)sample (with or without
replacement) of the groups or clusters identified by the fac
argument.
Usage
resample_factor(data, param = list(fac = "class", n = Inf, replace = FALSE))
Arguments
data |
a |
param |
a list with the following components: |
Details
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
.
Value
a data.frame
containing a subset of the rows of data
.
See Also
resample_strat_uniform()
, sample()
[Package sperrorest version 3.0.5 Index]