tab_tot | R Documentation |
tab
Add totals to a tab
tab_tot(
tabs,
tot = c("row", "col"),
name = "Total",
totcol = "last",
data = NULL
)
tabs |
A |
tot |
|
name |
The names of the totals, as a character vector of length one or two.
Use |
totcol |
|
data |
The original database used to calculate the |
A tibble
of class tab
. Total rows can then be detected using
is_totrow
, and total columns using is_totcol
.
data <- dplyr::starwars %>% tab_prepare(sex, hair_color)
data %>%
tab_plain(sex, hair_color) %>%
tab_tot("col", totcol = "each")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.