Convert Between Units

Provides conversion functionality between a broad range of scientific, historical, and industrial unit types.

Travis-CI Build Status

An R package for converting things to other things. The package is not on CRAN but can be installed using:


The package contains one function which converts numerical vectors from one unit to another. Data on conversion factors comes from the POSC Units of Measure Dictionary v2.2 and Wikipedia.

convert(1:20, "kg", "g")
convert(1:20, "sq yd", "km2")

#This will produce an error:
convert(1:20, "kg", "km2)

Units are converted using a lookup table, based on the POSC dictionary. You can explore this table using the explore_units() function. This function launches a shiny app.

Figuring out which units can be converted to each other can be tricky, so convertr comes with an an shiny gadget to help you build valid convert() expressions. This can be accesed either by calliing convert_gadget() or through the addin menu. To access the addin make sure you are using a recent version of RStudio.

Gadget Animation

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.



Version 0.11

Added explore_units function to provide a shiny interface to the conversion table Updated Documentation

Version 0.1

New Features

  • Added RStudio Add-in to build convertr expressions.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.1 by Gordon Shotwell, 2 years ago

Report a bug at

Browse source code at

Authors: Gordon Shotwell [aut, cre]

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports shiny, miniUI, DT, rstudioapi

Suggests testthat

See at CRAN