Description Usage Arguments Value Examples
View source: R/add_proportions.R
Add proportions by group
1 2 3 4 5 6 7 8 | add_proportion(
x,
y,
...,
name = "p",
percent_format = FALSE,
percent_accuracy = 0.01
)
|
x |
A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). |
y |
Variable to calculate proportions from. |
... |
< |
name |
The name of the new column in the output. If omitted, it will default to |
percent_format |
A logical. If |
percent_accuracy |
A numeric. If |
An object of the same type as x
. The output has the same groups as the input.
1 2 3 | mtcars %>%
dplyr::count(cyl) %>%
add_proportion(n)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.