tabf: Create an array of data frames splitting on a formula with...

View source: R/tab.R

tabfR Documentation

Create an array of data frames splitting on a formula with marginal faces

Description

Like a table but each element consists of the rows of the data frame for a particular combination of levels of the formula

Usage

tabf(dd, fmla, all = TRUE, ...)

Arguments

dd

data frame

fmla

formula whose RHS creates a table and LHS adds variables to the resulting data frames

all

adds all variables in the data frame

Examples

tabf(mtcars, ~ cyl + carb)[1,1]            
tabf(mtcars, ~ cyl + carb) %>% dimnames  
tabf(mtcars, ~ cyl + carb + gear ) %>% Apply(dim) %>% Apply(paste, collapse = ' ')  
          

gmonette/spida2 documentation built on Aug. 20, 2023, 7:21 p.m.