KreateTableOne: Create a table of descriptive statistics formatted for...

Description Usage Arguments Details Value See Also Examples

View source: R/KreateTableOne.R

Description

KreateTableOne is a wrapper for tableone::CreateTableOne which formats the original plain text table as a data.frame of character columns. This can be printed in an RMarkdown document in a number of ways, e.g., using knitr::kable. svyKreateTabeOne does the same with tableone::svyCreateTableOne.

Usage

1
2
3
KreateTableOne(x, printSMD = TRUE, ...)

svyKreateTableOne(x, ..., printSMD = TRUE)

Arguments

x

The data set to be passed to the data parameter of tableone::CreateTableOne

printSMD

Logical passed to smd parameter of tableone::CreateTableOne

...

Other parameters to be passed to tableone::CreateTableOne

Details

This is a very hacky function. If used within an RMarkdown document, KreateTableOne should be called in a code chunk with results='hide' to hide the plain test results printed from tableone::CreateTableOne. The resulting data frame should be saved as an object and used in a second code chunk for formatted printing. Suggestions for improvement are welcomed.

The function is written to work with knitr::kable, but should be able to work with other functions such as xtable::xtable.

Value

Returns a data frame of character columns.

See Also

CreateTableOne

Examples

1
2
3
table1 = KreateTableOne(x=mtcars, strata='am', factorVars='vs')
table1
knitr::kable(table1)

tldr documentation built on July 28, 2021, 5:09 p.m.