my_percent | R Documentation |
After counting or summarising in dplyr, generates percentages instead of probabilites. It is a wrapper around round(n/sum(n)*100).
my_percent(n, digits = 1)
n |
Character object. |
digits |
Number of decimal places to display. |
Column with percentage.
library(dplyr) mtcars %>% count(cyl) %>% mutate(p = my_percent(n))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.