out.html: HTML Output

out.htmlR Documentation

HTML Output

Description

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.

Usage

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)

Arguments

tab

A make.table or quick.table generated data frame. Required.

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).

Details

A call to this function is an optional argument to both make.table and quick.table via output='html'.

Value

A formatted HTML table in the Viewer or code for inclusion in a knitr document.

Author(s)

Erica Wozniak

See Also

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

Examples

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'
    )

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