tbl_cross | R Documentation |
The function creates a cross table of categorical variables.
tbl_cross(
data,
row = 1L,
col = 2L,
label = NULL,
statistic = ifelse(percent == "none", "{n}", "{n} ({p}%)"),
digits = NULL,
percent = c("none", "column", "row", "cell"),
margin = c("column", "row"),
missing = c("ifany", "always", "no"),
missing_text = "Unknown",
margin_text = "Total"
)
data |
( |
row |
( |
col |
( |
label |
( |
statistic |
( |
digits |
( |
percent |
( |
margin |
( |
missing |
( |
missing_text |
( |
margin_text |
( |
A tbl_cross
object
Karissa Whiting, Daniel D. Sjoberg
# Example 1 ----------------------------------
trial |>
tbl_cross(row = trt, col = response) |>
bold_labels()
# Example 2 ----------------------------------
trial |>
tbl_cross(row = stage, col = trt, percent = "cell") |>
add_p() |>
bold_labels()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.