Description Usage Arguments Value See Also Examples
Take numeric vectors of numerators, and demoninators, round them, format them with trailing zeros, and return as a character string along with the original numeric values.'
1 2 | pretty_percentage(num, denom, digits = 2, percent_scaling = 100,
as_per = TRUE, ...)
|
num |
A numeric or character vector coercible to a numeric vector. Empty character vectors will be returned by the function. |
denom |
A numeric vector |
digits |
Integer indicating the number of decimal places to be used. |
percent_scaling |
A numeric vector indicating the scaling used, by default this is 100 as this gives a percentage. |
as_per |
Logical indicating if the percentage should be deliminated by a % symbol. |
... |
Pass additional arguements to |
A character vector or string, with a percentage and the numerator and denominator used to calculate it
pretty_round pretty_ci
1 2 3 4 5 6 7 8 | ## Return a percentage
pretty_percentage(10, 500)
## Return a vector of percentages
pretty_percentage(c(1,4,6, 19), 100, digits = 1)
## Return a proportion
pretty_percentage(c(1, 2, 4, 5, 2), c(100, 40, 50, 40, 30), as_per = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.