View source: R/KreateTableOne.R
| KreateTableOne | R Documentation |
KreateTableOne is a wrapper for tableone::CreateTableOne which
formats the original plain text table as a data.frame of character columns.
KnitableTableOne is a wrapper for tableone::print.TableOne which
allows for more versatility in printing options. The output of both functions
can be printed in an RMarkdown document in a number of ways, e.g., using
knitr::kable. svyKreateTabeOne does the same with
tableone::svyCreateTableOne for complex survey data.
KreateTableOne(...)
svyKreateTableOne(...)
KnitableTableOne(x, ...)
... |
Parameters to be passed to |
x |
A TableOne object created from |
These are very hacky functions. If used within an RMarkdown document,
KreateTableOne and KnitableTableOne 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.
CreateTableOne print.TableOne
table1 = KreateTableOne(data=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.