Learn R Programming

units (version 0.4-2)

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

Description

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

Usage

"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)

Value

object of class units

Examples

Run this code
a <- with(ud_units, 1:3 * m/s)
b <- with(ud_units, 1:3 * m/s)
a + b
a * b
a / b
a <- make_unit("kg m-3") # not understood by R as a division, but understood by udunits2
b <- with(ud_units, 1 * kg/m/m/m)
a + b

Run the code above in your browser using DataLab