sample_group: Sampling one grouping variable from a nested dataframe. The...

View source: R/samplesubset.R

sample_groupR Documentation

Sampling one grouping variable from a nested dataframe. The sampling could be done either randomly or a specific row could be indicated.

Description

This function will return a dataframe of the grouping variable from the input nested dataframe.

Usage

sample_group(nest_df, index)

Arguments

nest_df

The nested dataframe to be sampled from. The right-most column must be a dataframe type with name 'data'.

index

Optional. The index of the dataframe to be sampled from. If no index is provided, a random subset will be returned.


wanjiag/ezPurrr documentation built on May 10, 2022, 9:32 p.m.