unit_format

0th

Percentile

Add units to the labels

Add units to the labels

Usage
unit_format(unit = "m", scale = 1, sep = " ", ...)
Arguments
unit
The units to append
scale
A scaling factor. Useful if the underlying data is on another scale
sep
The separator between the number and the label
...
Arguments passed on to format
See Also

comma

Aliases
  • unit_format
Examples
# labels in kilometer when the raw data are in meter
km <- unit_format(unit = "km", scale = 1e-3, digits = 2)
km(runif(10) * 1e3)

# labels in hectares, raw data in square meters
ha <- unit_format(unit = "ha", scale = 1e-4)
km(runif(10) * 1e5)
Documentation reproduced from package scales, version 0.3.0, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.