View source: R/style_percent.R
style_percent | R Documentation |
Style percentages
style_percent(
x,
digits = 0,
big.mark = ifelse(decimal.mark == ",", " ", ","),
decimal.mark = getOption("OutDec"),
prefix = "",
suffix = "",
symbol,
...
)
x |
numeric vector of percentages |
digits |
number of digits to round large percentages (i.e. greater than 10%).
Smaller percentages are rounded to |
big.mark |
( |
decimal.mark |
( |
prefix |
( |
suffix |
( |
symbol |
Logical indicator to include percent symbol in output.
Default is |
... |
Arguments passed on to |
A character vector of styled percentages
Daniel D. Sjoberg
percent_vals <- c(-1, 0, 0.0001, 0.005, 0.01, 0.10, 0.45356, 0.99, 1.45)
style_percent(percent_vals)
style_percent(percent_vals, suffix = "%", digits = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.