| bcat_fmt_percent | R Documentation |
A wrapper for scales::label_percent to format a numeric vector to percentages.
bcat_fmt_percent(x, accuracy = NULL, scale = 100, ...)
x |
a numeric vector |
accuracy |
A number to round to. Use (e.g.) |
scale |
A scaling factor: |
... |
other arguments passed to label_percent |
A character vector of formatted percentage labels with the same length
as x.
Other formatting:
bcat_fmt_comma(),
bcat_fmt_date(),
bcat_fmt_dollar(),
bcat_fmt_pvalue(),
bcat_fmt_scientific()
bcat_fmt_percent(c(0.01, 0.05, 0.02))
bcat_fmt_percent(c(0.0151321, 0.090115, 0.022141))
bcat_fmt_percent(c(0.0151321, 0.090115, 0.022141), accuracy = 0.001)
bcat_fmt_percent(c(1.31, 2.44, 3.0), scale = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.