uniteGroup | R Documentation |
Unites targeted table columns into group_name-group_level columns.
uniteGroup(x, cols = character(0), keep = FALSE, ignore = c(NA, "overall"))
x |
Tibble or dataframe. |
cols |
Columns to aggregate. |
keep |
Whether to keep the original columns. |
ignore |
Level values to ignore. |
A tibble with the new columns.
x <- dplyr::tibble(
variable = "number subjects",
value = c(10, 15, 40, 78),
sex = c("Male", "Female", "Male", "Female"),
age_group = c("<40", ">40", ">40", "<40")
)
x |>
uniteGroup(c("sex", "age_group"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.