| groupGeneric.errors | R Documentation |
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).
## S3 method for class 'errors'
Math(x, ...)
## S3 method for class 'errors'
Ops(e1, e2)
## S3 method for class 'errors'
Summary(..., na.rm = FALSE)
x, e1, e2 |
objects. |
... |
further arguments passed to methods. |
na.rm |
logical: should missing values be removed? |
MathThe 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.
OpsBoolean 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.
SummaryThe 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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.