Description Usage Arguments Value References Examples
Unit conversion function "from"-"to"
1 | uc(x, from, to)
|
x |
A quantity to be conversed (atomic vector or list) |
from |
Valid unit name (character) |
to |
Valid unit name (character) |
Converted quantity (atomic vector or list as per input)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | uc(1, "mkm2", "D")
uc(1, "mkm2", "mD")
uc(u(1:5, "kg"), "kg", "lb")
uc(u(list(1, 2), "ton"), "ton", "lb")
uc(u(data.frame(x1 = 1:3, x2 = 4:6), "ft3"), "ft3", "cm3")
uc(1, "ft3", "l")
uc(1, "ft3", "cm3")
uc(1, "bbl", "l")
uc(150, "m", "km") + u(c(1.0, 2.0, 3.5), "km")
uc(1.5, "cP", "Pa*s")
# Example below with correct units
uc(1, "kg/m3", "lb/ft3")
# Example below with incorrect units causes an error
## Not run: uc(1, "kg/m3", "lbft3")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.