sample_n_of: Sample Groups at Random

Description Usage Arguments Examples

View source: R/sample_n_of.R

Description

Sample groups from a data set just as one would do using sample_n(). Based on a similar function from TJ Mahr's package tjmisc.

Usage

1

Arguments

data

A tibble or data frame.

size

The number of groups you want to sample.

replace

Whether to sample with replacement or not. Defaults to TRUE.

...

The group you want to sample.

Examples

1
sample_n_of(iris, 2, replace = FALSE, Species)

jackobailey/jbmisc documentation built on Dec. 14, 2021, 12:11 a.m.