| filterRandom {iNZightTools} | R Documentation |
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.
filterRandom(.data, n, sample_size)
.data |
a dataframe to sample from |
n |
the number of groups to generate |
sample_size |
the size of each group specified in |
a dataframe containing the random samples with tidyverse code attached
Owen Jin
filtered <- filterRandom(iris, n = 5, sample_size = 3) cat(code(filtered)) head(filtered)