combine_n_pct | R Documentation |
Combine N and Percent Columns for Accessibility
combine_n_pct(df, n, pct, name, remove = TRUE, na_replace = NULL)
df |
A data frame that has already been sent to |
n |
The unquoted name of the column containing count values |
pct |
The unquoted name of the column containing percentage values |
name |
The name of the new combined column to be created |
remove |
Logical. Should the existing |
na_replace |
Character string representing how missing values should be represented. |
A data frame.
pcts <- tibble::tibble(Program = c("A", "B", "C", "D", "E", "F"),
n = 0:5,
p = 0.5 * (0:5))
pcts |>
fmt_table() |>
combine_n_pct(n = n, pct = p, name = "States")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.