Skip to contents

Useful for condensed displays like axis titles

Usage

unit_shorthand(x, units = unit_trans)

Arguments

x

chr/tbl Character or data.frame with long form names. Currently supports Acre-feet = AF,Months = mths,Percent = %,Years = yrs,Number = #,Cubic feet per second = Ft^3/s,Million Acre-Feet = MAF,Megawatt-hours = MWh,Megawatts = MW,Gigawatt-hours = GWh,Gigawatt = GW,Feet = Ft

units

chr Unit translation vector with shorthand as the vectur and long form names as the names. Uses unit_trans as default, append additional for specific translations not yet represent in unit_trans and open a PR or issue to add the translations if inclined.

Value

chr/tbl with same class as x

Examples

unit_shorthand(tibble::tibble("Max Gigawatt-hours" = 5, "Really big number" = 10^6))
#> # A tibble: 1 × 2
#>   `Max GWh` `Really big number`
#>       <dbl>               <dbl>
#> 1         5             1000000