Table1-package | R Documentation |
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.
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.
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.
Erica Wozniak
Maintainer: Erica Wozniak <ewozniak@mcw.edu>
make.table
quick.table
cat.var
cont.var
stat.col
out.plain
out.latex
out.html
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' )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.