prefixes: SI prefixes

Description Details Author(s) References Examples

Description

SI prefixes are defined as constant factors like kilo <- 1000

Details

SI prefixes are defined as constant factors like kilo <- 1000 The use of constants for SI prefixes will make your code readable. It reduces the risk of mistakes and supports the usage of SI units. The BIPM provides a list of prefixes. All of them are available as constants in sitools.

Author(s)

Jonas Stein news@jonasstein.de https://github.com/jonasstein/sitools

References

http://www.bipm.org/en/si/si_brochure/chapter3/prefixes.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(sitools)

# dice have a volume of (in metres)
a <- 1 * centi
volumedice <- a^3
volumedice

# how many dice fit in a box with
# 10 cm height
# 20 cm length 
# 30 cm width

volumebox <- 10*centi * 20*centi * 30*centi

volumebox / volumedice

Example output

[1] 1e-06
[1] 6000

sitools documentation built on May 2, 2019, 3:46 p.m.