unit_format {scales} | R Documentation |
Add units to the labels
unit_format(unit = "m", scale = 1, sep = " ", ...)
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 |
# 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)