Description Usage Arguments Value Examples
This function provides a wrapper around furniture::table1
that allows it to
utilize Hmisc::label
as variable labels. It also automatically converts logicals
to factors so logical dataframe columns are included in the table.
1 2 3 4 5 6 7 8 9 10 11 |
df |
a dataframe |
... |
a list of columns to be included in the table |
group |
a group to split the columns by |
neg_label |
label of the negative |
pos_label |
label of the positive |
test |
logical; if set to |
caption |
when |
output |
how the table is output; can be "text" or "text2" for regular console output or any of |
type |
what is displayed in the table; a string or a vector of strings. Two main sections can be inputted: 1. if test = TRUE, can write "pvalues", "full", or "stars" and 2. can state "simple" and/or "condense". These are discussed in more depth in the details section below. |
a table; the output varies based on the output
parameter.
1 2 3 4 5 6 7 8 9 | diamonds <- ggplot2::diamonds
diamonds$expensive <- diamonds$price > 500
Hmisc::label(diamonds$depth) <- "Depth"
Hmisc::label(diamonds$table) <- "Table"
Hmisc::label(diamonds$price) <- "Price"
Hmisc::label(diamonds$clarity) <- "Clarity"
Hmisc::label(diamonds$cut) <- "Cut"
Hmisc::label(diamonds$expensive) <- "Expensive"
diamonds %>% tableone(depth, table, price, clarity, expensive, group = cut)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.