Table1-package: Summary Table

Table1-packageR Documentation

Summary Table

Description

This package creates data frames of formatted summaries for categorical and continuous variables. Basic significance tests across strata are available, in addition to several one-sample tests. Options to output results to LaTeX, HTML, and plain text to the console are currently supported.

Details

This package was not yet installed at build time.
The main summary functions in this package are make.table and quick.table. The make.table function accepts separate vectorized inputs for categorical and continuous variables and provides numerous options to customize table output, including significance testing. By contrast, quick.table allows for very little customization; it is instead intended to generate rapid summaries of datasets with minimal input, dynamically classifying each variable as either categorical or continuous. Index: This package was not yet installed at build time.

Note

You must clean (e.g., replace blank entries with NAs) the data frame of interest before applying these functions.

Working installations of xtable and htmlTable are required for LaTeX and HTML output, respectively.

Author(s)

Erica Wozniak

Maintainer: Erica Wozniak <ewozniak@mcw.edu>

See Also

make.table quick.table cat.var cont.var stat.col out.plain out.latex out.html

Examples

library(survival)
library(htmlTable)
attach(pbc)

#Plain text table generated with make.table using vectorized inputs
make.table(dat   = pbc,
    cat.varlist  = c('stage', 'sex'),
    cat.header   = c('Stage', 'Sex'),
    cat.rownames = list(c('I', 'II', 'III', 'IV'), c('Male', 'Female')),
    cat.ptype    = c('fisher', 'fisher'),   
    cont.varlist = c('bili', 'copper'),
    cont.header  = c('Bilirubin', 'Urine copper'),
    cont.ptype   = c('wilcox', 'wilcox'), 
    strat        = c('trt'),
    # Remove row percents from all categorical variables (list is recycled)
    cat.rmstat   = list('row'),
    # Remove missing, min/max from bili and no summary stats from copper
    cont.rmstat  = list(c('miss', 'minmax'), 'None'),
    colnames     = c('', 'D-penicillamine', 'Placebo', 'Overall', 'p-value')
    )
    
# HTML table generated with quick.table 
library(htmlTable)
quick.table(dat = pbc,
    strat       = 'sex',
    colnames    = c('', 'Male', 'Female', 'Overall'),
    # See www.color-hex.com for codes
    output      = 'html',
    stripe.col  = '#d0f2b0'
    )

emwozniak/Table1 documentation built on Oct. 5, 2022, 12:20 a.m.