convert_num2percent | R Documentation |
convert_num2percent
will convert all numbers into percent values with a defined precision.
As an alternative, percent
or label_percent
can be used.
convert_num2percent(x, digits = 2, format = "f", suffix = "%", ...)
x |
Integer vector. |
digits |
Integer for rounding precision. |
format |
Character vector ('f' or 'g') passed to |
suffix |
Character value to append to the end of the number (default is '%'). |
... |
Additional parameters passed to |
Character vector.
Richie Cotton.
Implemented from Richie Cotton's StackOverflow contribution: https://stackoverflow.com/questions/7145826/how-to-format-a-number-as-percentage-in-r
percent
label_percent
(e.g. label_percent()(x)
)
x <- c(-1, 0, 0.1, 0.5667, 1, 100.2)
convert_num2percent(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.