Learn R Programming

OpasnetUtils (version 1.1.0)

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, so the units used have to be specified there. 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