Ops.units: S3 Ops Group Generic Functions for units objects

Description Usage Arguments Value Examples

View source: R/arith.R

Description

Ops functions for units objects, including comparison, product and divide, add, subtract

Usage

1
2
## S3 method for class 'units'
Ops(e1, e2)

Arguments

e1

object of class units, or something that can be coerced to it by as_units(e1)

e2

object of class units, or something that can be coerced to it by as_units(e2), or in case of power a number (integer n or 1/n)

Value

object of class units

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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 )

r-quantities/units documentation built on Nov. 6, 2019, 11:44 a.m.