sample_n_groups: Randomly subsample data by group

Description Usage Arguments Value

Description

Wraps dplyr::sample_n. Subsampling will be done at the level of the specified group column, within any grouping that already exists in the input tbl.

Usage

1

Arguments

tbl

tbl of data

group

(quoted) grouping variable

n

number of samples

...

additional arguments are passed to dplyr::sample_n.

Value

A tbl with n levels of group randomly sampled within each existing grouping level of tbl. Any grouping of tbl is preserved in the return value.


kleinschmidt/phondisttools documentation built on May 20, 2019, 5:57 p.m.