out.latex: LaTeX Output

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Table1.R

Description

This function utilizes xtable to output summary table results to the console as formatted LaTeX code, and may be used within a Sweave or knitr document.

Usage

1
  out.latex(tab, colnames, header.style, factor.style, stat.style)

Arguments

tab

A single call to either cat.var or cont.var, or a data frame produced via rbind of multiple calls to these functions. Required.

colnames

A vector of column names for the table output. Optional.

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

Details

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

Value

LaTeX code for a formatted table.

Author(s)

Erica Wozniak

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
library(xtable)
library(survival)

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('Variable', 'D-penicillamine', 'Placebo', 'Overall', 'p-value'),
    output       = 'latex'
    )

emwozniak/Table1 documentation built on May 13, 2017, 6:06 p.m.