Easily translate long form unit names to shorthand
unit_shorthand.Rd
Useful for condensed displays like axis titles
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. Usesunit_trans
as default, append additional for specific translations not yet represent inunit_trans
and open a PR or issue to add the translations if inclined.
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