groupGeneric.quantities: S3 Group Generic Functions

Description Usage Arguments Details Examples

Description

Math, Ops and Summary group generic methods for quantities objects (see groupGeneric for a comprehensive list of available methods).

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'quantities'
Math(x, ...)

## S3 method for class 'quantities'
Ops(e1, e2)

## S3 method for class 'quantities'
Summary(..., na.rm = FALSE)

Arguments

x

objects.

...

further arguments passed to methods.

e1

objects.

e2

objects.

na.rm

logical: should missing values be removed?

Details

See groupGeneric.errors, Ops.units, Math.units, for further details.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
x <- set_quantities(1:3, m/s, 0.1)
log(x)
cumsum(x)
cumprod(x)

a <- set_quantities(1:3, m/s, 0.1)
b <- set_quantities(1:3, m/s, 0.1)
a + b
a * b
a / b
a = set_quantities(1:5, m, 0.1)
a %/% a
a %/% set_quantities(2)
set_quantities(1:5, m^2, 0.1) %/% set_quantities(2, m, 0.1)
a %% a
a %% set_quantities(2)
c(min(x), max(x))
range(x)
sum(x)

quantities documentation built on Feb. 22, 2021, 9:09 a.m.