Learn R Programming

omnibus (version 1.2.15)

expandUnits: Convert unit abbreviations to proper unit names

Description

This function converts abbreviations of length and area units (e.g., "m", "km", and "ha") to their proper names (e.g., "meters", "kilometers", "hectares"). Square areal units are specified using an appended "2", where appropriate (e.g., "m2" means "meters-squared" and will be converted to "meters2").

Usage

expandUnits(x)

Arguments

x

Character: Abbreviations to convert. Case is ignored.

  • 'm' will be converted to 'meters'

  • 'm2' will be converted to 'meters2'

  • 'km' will be converted to 'kilometers'

  • 'km2' will be converted to 'kilometers2'

  • 'mi' will be converted to 'miles'

  • 'mi2' will be converted to 'miles2'

  • 'ft' will be converted to 'feet'

  • 'ft2' will be converted to 'feet2'

  • 'yd' will be converted to 'yards'

  • 'yd2' will be converted to 'yards2'

  • 'ac' will be converted to 'acres'

  • 'ha' will be converted to 'hectares'

  • 'nmi' will be converted to 'nautical miles'

  • 'nmi2' will be converted to 'nautical miles2'

See Also

convertUnits, conversionFactors

Examples

Run this code

expandUnits(c('m', 'm2', 'ac', 'nm2'))

Run the code above in your browser using DataLab