tab_df: Return a table as as data frame

View source: R/tab.R

tab_dfR Documentation

Return a table as as data frame

Description

Return a table as as data frame

Usage

tab_df(data, fmla, ...)

Arguments

data

a data frame

fmla

a one-sided or two-sided formula

...

other arguments to tab

Details

The right hand side of 'fmla' is used for the dimensions of the table. The left-hand side, if present, is summed to generate the values in the cells of the table. If there is no left-hand side, cell frequencies are shown.

tab_df(data, fmla) is similar in effect to as.data.frame(tab_(data, fmla)) except that the former uses the name in the LHS of fmla as a variable name for counts while the latter uses 'Freq'. Also, tab_df preserved ordered factors.


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