Unit conversions

From Opasnet
Jump to navigation Jump to search



The code related to this tool is now a part of Opasnet (R library).

Question

How to convert data from one unit to another in R?

Answer

We need conversion factors, which are listed below, and a code that does the actual conversion.

Unit conversions(-)
ObsFromToTypeResultDescription
1Prefix1
2daPrefix10deca
3hPrefix100hecto
4kPrefix1000kilo
5MPrefix1e+6mega
6GPrefix1e+9giga
7TPrefix1e+12tera
8PPrefix1e+15peta
9EPrefix1e+18exa
10ZPrefix1e+21zetta
11YPrefix1e+24yotta
12dPrefix0.1deci
13cPrefix0.01centi
14mPrefix0.001milli
15μPrefix1e-6micro
16uPrefix1e-6micro
17nPrefix1e-9nano
18pPrefix1e-12pico
19fPrefix1e-15femto
20aPrefix1e-18atto
21zPrefix1e-21zepto
22yPrefix1e-24yocto
23JJUnit1Joule, the base unit for energy
24WhJUnit36001 Wh = 1 Wh * 3600 s/h = 3600 Ws = 3600 MJ
25toeJUnit3.5e+101 toe = 1000 kgoe = 1000 kg * 35 MJ/kg = 35000 MJ (energy as tons of oil equivalent)
26ggUnit1gram, the base unit for mass (although the definition is based on kg)
27tongUnit1e+6metric ton
28tngUnit1e+6metric ton
29ssUnit1second, the base unit for time
30minsUnit60minute
31hsUnit3600hour
32dsUnit86400day
33asUnit31557600year (assuming 365.25 days per year)
34mmUnit1metre, the base unit of length
35inmUnit0.0254inch (strangely, some people still use these)
36ftmUnit0.3048foot = 12 inches
37mimUnit1609.344mile = 5280 feet
38m3m3Unit1cubic metre, the basic unit of colume
39lm3Unit0.001litre
40m^3m3Unit1

What is the amount?:

In what units is it?:

To what unit do you want it?:

+ Show code

Rationale

See also

References


Related files

<mfanonymousfilelist></mfanonymousfilelist>