format.demoTable: Format a tabulated summary for LaTeX

View source: R/format.demoTable.r

format.demoTableR Documentation

Format a tabulated summary for LaTeX

Description

Format a tabulated summary for LaTeX

Usage

## S3 method for class 'demoTable'
format(x, ..., formula)

Arguments

x

output from tabSummarize of class demoTable

...

ignored

formula

the same formula as used to create the tabSummarize output

Value

Table with summarized data formatted for inclusion in LaTeX (character matrix)

Note

This function is primarily used for demographics tables

See Also

tabStats, tabSummarize

Examples

options(width = 150)
pkpdData = example.pkpdData()
ok = duplicated(pkpdData$id) == FALSE
myFormula =  dose ~ race + wt + bmi + sex
my.formatted.demoTable = format(
 tabSummarize(formula = myFormula, data = pkpdData[ok, ], digits = 3),
  formula = myFormula
)
library(xtable)
my.xtable <- xtable(my.formatted.demoTable)
print(my.xtable
  , sanitize.text.function = identity
  , booktabs = TRUE
)

qPharmetra/qpToolkit documentation built on May 24, 2023, 8:52 a.m.