Style percentages
Style percentages
style_percent( x, symbol = FALSE, digits = 0, big.mark = NULL, decimal.mark = NULL, ... )
x |
numeric vector of percentages |
symbol |
Logical indicator to include percent symbol in output.
Default is |
digits |
number of digits to round large percentages (i.e. greater than 10%).
Smaller percentages are rounded to |
big.mark |
Character used between every 3 digits to separate
hundreds/thousands/millions/etc.
Default is |
decimal.mark |
The character to be used to indicate the numeric decimal point.
Default is |
... |
Other arguments passed on to |
A character vector of styled percentages
Daniel D. Sjoberg
See Table Gallery vignette for example
Other style tools:
style_number()
,
style_pvalue()
,
style_ratio()
,
style_sigfig()
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, symbol = TRUE, digits = 1)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.