tbl_strata: Stratify Data

Description Usage Arguments Value

View source: R/model-helpers.R

Description

Stratify a data frame by a list of strata

Usage

1
tbl_strata(df, strata, name_all = "All", sep = "___")

Arguments

df

The data to be stratified.

strata

List of vectors to stratify by.

name_all

The indicator name for the strata containing all observations

sep

Separator

...

Additional arguments sent to 'broom::tidy'.

Value

Tibble containing stratified data.

strata should be a list of vectors to stratify df by; each vector should have length = nrow(df); if named list, then the names become columns in the data frame (duplicate names are ajusted); if not a named list, then generic names are made


icj/mecfun documentation built on Nov. 4, 2019, 1:54 p.m.