Learn R Programming

OpasnetUtils (version 1.3)

convert.units: Converting units

Description

Converts units (to SI equivalents by default)

Usage

convert.units(x, tounit = c("kg", "s", "m", "m3", "J", "W", "A", 
    "V", "C", "N", "Pa", "Hz", "mol"), fromunit = NULL)

Arguments

x

numeric vector with values to be converted

tounit

character vector of the new units to be used

fromunit

character vector or factor with the current units

Value

Returns a data.frame

Details

Uses the table in en.opasnet.org/w/Unit_conversions for the conversions, which can be edited to contain relevant units.

See also: http://en.opasnet.org/

Examples

Run this code

convert.units(1, tounit = c("pg", "l"), fromunit = "ug /m3")

Run the code above in your browser using DataLab