add_perc | R Documentation |
Adds a percentage column based on the counts in the count_col. Automatically quoted. .total is to specify a total count (e.g. in chooseany columns, where the sum is not the same as the total N) name is the name of the column to add margins is which columns to add margins for (tidy-select)
add_perc(
x,
count_col = NULL,
.total = NULL,
name = "perc",
margins = NULL,
format = TRUE
)
x |
The dataset |
count_col |
The name of the column (tidy-select) that contains which column should be counted |
.total |
(optional) The name of the column containing totals |
name |
The name of the new column being added with the percentage (default: "perc") |
format |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.