Learn R Programming

convertr (version 0.1)

convert: Convert from one unit type to another

Description

Converts numeric vectors from one unit to another Approximately 1500 units are available. convert_gadget can help you build valid convert() expressions and explore_units provides an interface for exploring the conversion_table which underlies the computation.

Usage

convert(vector, origin, target)

Arguments

vector
A numeric vector to be converted
origin
The catalog symbol of the current unit.
target
The catalog symbol of unit you want to convert to.

Value

A numeric vector

Examples

Run this code
convert(1:20, "kg", "g")
convert(1:20, "galUK/min.ft2", "kft/s")
## Not run: 
# convert(1:20, "kg", "km2")
# ## End(Not run)

Run the code above in your browser using DataLab