sample_n_groups: dplyr::sample_n lacks the functionality of sampling group_by...

Description Usage Arguments Value

View source: R/sample_n_groups.R

Description

dplyr::sample_n lacks the functionality of sampling group_by variables. Instead, it is only capable of sampling rows in a table. sample_n_groups() samples a number of groups in a previously grouped_by tibble. the tibble must be grouped before calling the function.

Usage

1
sample_n_groups(tbl, size, replace = FALSE, weight = NULL)

Arguments

tbl

A tibble

size

number of groups to sample

replace

sample with or without replacement

weight

sampling weights

Value

A tibble


HSPS-DataScience/HSPSUtils documentation built on May 24, 2019, 7:37 a.m.