Description Usage Arguments Details Value See Also Examples
View source: R/KreateTableOne.R
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
.
1 2 3 | KreateTableOne(x, printSMD = TRUE, ...)
svyKreateTableOne(x, ..., printSMD = TRUE)
|
x |
The data set to be passed to the |
printSMD |
Logical passed to |
... |
Other parameters to be passed to |
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
.
Returns a data frame of character columns.
1 2 3 | table1 = KreateTableOne(x=mtcars, strata='am', factorVars='vs')
table1
knitr::kable(table1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.