filterRandom {iNZightTools}R Documentation

Random sampling without replacement

Description

Take a specified number of groups of observations with fixed group size by sampling without replacement and returns the result along with tidyverse code used to generate it.

Usage

filterRandom(.data, n, sample_size)

Arguments

.data

a dataframe to sample from

n

the number of groups to generate

sample_size

the size of each group specified in n

Value

a dataframe containing the random samples with tidyverse code attached

Author(s)

Owen Jin

See Also

code

Examples

filtered <- filterRandom(iris, n = 5, sample_size = 3)
cat(code(filtered))
head(filtered)


[Package iNZightTools version 1.12.2 Index]