out.html | R Documentation |
This function utilizes htmlTable
to output the results of the make.table
and quick.table
functions to the R Viewer as a formatted HTML table, and may be used within a knitr document.
out.html(tab, colnames, stripe, stripe.col, header.style, factor.style, stat.style, caption, footer, tspanner, n.tspanner, cgroup, n.cgroup, col.columns, nowrap, vspace)
tab |
A |
colnames |
A vector of column names for the table output. Optional. |
stripe |
Logical indicator for whether to include lightly shaded zebra striping of every other variable in the output. Optional; defaults to TRUE. |
stripe.col |
Hex code for the color of the zebra striping. Optional; defaults to a light gray, #F7F7F7. |
header.style |
Variable name style: "plain", "bold", "italic", or "bolditalic". Optional; defaults to "bold". |
factor.style |
Variable factor levels style: "plain", "bold", "italic", or "bolditalic". Optional; defaults to "bold". |
stat.style |
Summary statistic style: "plain", "bold", "italic", or "bolditalic". Optional; defaults to "plain". |
caption |
Table caption. Optional; no default. |
footer |
Table footer. Optional; no default. |
tspanner |
Rowwise table spanner, passed to htmlTable. Optional; see ?htmlTable for default information. |
n.tspanner |
Vector of rows in each table spanner, passed to htmlTable. Optional; see ?htmlTable for default information. |
cgroup |
Column group headers, passed to htmlTable. Optional; see ?htmlTable for default information. |
n.cgroup |
Vector of columns under each group header, passed to htmlTable. Optional; see ?htmlTable for default information. |
col.columns |
Vector of column colors, passed to htmlTable. Optional; defaults to "none". |
nowrap |
Option to prevent text wrapping of long lines to the table output. Useful for generating wide tables with knitr. Optional; defaults to TRUE. |
vspace |
TRUE for additional vertical whitespace between variables (default). |
A call to this function is an optional argument to both make.table
and quick.table
via output='html'.
A formatted HTML table in the Viewer or code for inclusion in a knitr document.
Erica Wozniak
Table1
make.table
quick.table
cat.var
cont.var
stat.col
out.plain
out.latex
library(survival) library(htmlTable) 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'), cat.rmstat = list('row'), colnames = c('', 'D-penicillamine', 'Placebo', 'Overall', 'p-value'), output = 'html', # Check out \url{www.color-hex.com} stripe.col = '#f4dfd0' )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.