Description Usage Arguments Details Value Examples
This function provides a wrapper around table1::table1
that allows it to
create a column for P-values and perform the appropriate statistical tests. It also adds functionality
for captions and table numbering.
1 | make_table1(df, group, ..., negative_label = "No", caption, table_num)
|
df |
a dataframe |
group |
a group to split the columns by. Must be a logical or a factor with two levels. |
... |
a list of columns to be included in the table |
negative_label |
a word to prepend to the label of the negative |
caption |
an optional caption |
table_num |
an optional table number |
Currently only works if you intend to split by the variable group
, which must be a logical or a factor with two levels.
an HTML table
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 %>% make_table1(group = expensive, depth, clarity, cut, negative_label = "Not")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.