groupGeneric.errors: S3 Group Generic Functions

Description Usage Arguments Details Examples

Description

Math, Ops and Summary group generic methods for errors objects with support for automatic uncertainty propagation (see groupGeneric for a comprehensive list of available methods).

Usage

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

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

## S3 method for class 'errors'
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

Math

The sign method returns a numeric value without uncertainty. floor, ceiling, trunc, round and signif add the rounding error to the original uncertainty. lgamma, gamma, digamma and trigamma are not implemented. The rest of the methods propagate the uncertainty as expected from the first-order Taylor series method.

Ops

Boolean operators drop the uncertainty (showing a warning once) and operate on the numeric values. The rest of the operators propagate the uncertainty as expected from the first-order Taylor series method. Any numeric operand is automatically coerced to errors (showing a warning once) with no uncertainty.

Summary

The methods all and any are not supported for errors objects and fail with an informative message. min, max (and range) return the minimum or (and) maximum value minus/plus its uncertainty. sum and prod propagate the uncertainty as expected from the first-order Taylor series method.

Examples

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

y <- set_errors(4:6, 0.2)
x / sqrt(y) + y * sin(x)

# numeric values are automatically coerced to errors
x^2

# boolean operators drop uncertainty
y > x

c(min(x), max(x))
range(x)
sum(y)
prod(y)

errors documentation built on July 26, 2018, 5:03 p.m.