tab2word: tab2word

Description Usage Arguments Examples

View source: R/tab2word.R

Description

This function accepts a table made in tib2tab and outputs a formatted word document

Usage

1
tab2word(table, file, footer, colwid = 1, headnames = NA)

Arguments

table

a table

file

output file path

footer

footer text

colwid

column width

headnames

list of strings for header column titles

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
tib <- dat2tib(data = cdisc_data, 
               model = lm(aval ~ arm + age + sex), 
               outcome = aval, 
               trt = arm, 
               nest = param, 
               tran='none')
               
tab <- tib2tab(mtib = tib, 
        stat_fmt = "{mean} ({sd})", 
        comp_fmt = "{estimate} ({lower_CL}, {upper_CL})")
        
tab2word(tab, 
         file = 'tabletest.docx', 
         footer = 'Table created with dat2stat R package', 
         colwid = 1)

## End(Not run)

RhoInc/dat2stat documentation built on Nov. 15, 2019, 10:06 a.m.