View source: R/format_metric.R
format_metric | R Documentation |
format a numeric vector using metric system
format_metric(
x,
prefixes = c("", "k", "M", "G"),
digits = 3,
smart_signif = FALSE,
symbol = TRUE,
base_unit = "",
...
)
x |
a numeric vector |
prefixes |
a vector or prefixes (”,'k', 'M', ...), lower case symbols (”,'kilo', 'mega' ...) or powers of tens (0, 3, 6 ...). |
digits |
integer used by signif or smart_signif |
smart_signif |
logical, if TRUE smart_signif will be used instead of signif |
symbol |
logical, if TRUE, full symbol will be used, else prefix will be used |
base_unit |
character, e.g. 'g' |
... |
additional arguments passed to formatC |
formated character
format_metric(c(-2500,0.15,3,5e6),c(0,3))
format_metric(c(-2500,0.15,3,5e6),"kilo")
format_metric(c(-2500,0.15,3,5e6),base_unit="\U{20AC}")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.