Ops.units | R Documentation |
Ops functions for units objects, including comparison, product and divide, add, subtract.
## S3 method for class 'units'
Ops(e1, e2)
e1 |
object of class |
e2 |
object of class |
Users are advised against performing arithmetical operations with temperatures in different units. The units package ensure that results 1) are arithmetically correct, and 2) satisfy dimensional analysis, but could never ensure that results are physically meaningful. Temperature units are special because there is an absolute unit, Kelvin, and relative ones, Celsius and Fahrenheit degrees. Arithmetic operations between them are meaningless from the physical standpoint. Users are thus advised to convert all temperatures to Kelvin before operating.
object of class units
a <- set_units(1:3, m/s)
b <- set_units(1:3, m/s)
a + b
a * b
a / b
a <- as_units("kg m-3")
b <- set_units(1, kg/m/m/m)
a + b
a = set_units(1:5, m)
a %/% a
a %/% set_units(2)
set_units(1:5, m^2) %/% set_units(2, m)
a %% a
a %% set_units(2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.