Summary {salad} | R Documentation |
Summary methods for objects of class dual
Description
Methods extending to dual objects the corresponding methods for numeric objects.
Usage
## S3 method for class 'dual'
sum(x, ..., na.rm = FALSE)
## S4 method for signature 'numericOrArray'
sum(x, ..., na.rm = FALSE)
## S3 method for class 'dual'
prod(x, ..., na.rm = FALSE)
## S4 method for signature 'numericOrArray'
prod(x, ..., na.rm = FALSE)
## S3 method for class 'dual'
max(x, ..., na.rm = TRUE)
## S4 method for signature 'numericOrArray'
max(x, ..., na.rm = TRUE)
## S3 method for class 'dual'
min(x, ..., na.rm = TRUE)
## S4 method for signature 'numericOrArray'
min(x, ..., na.rm = TRUE)
## S3 method for class 'dual'
range(x, ..., na.rm = TRUE)
## S4 method for signature 'numericOrArray'
range(x, ..., na.rm = TRUE)
## S4 method for signature 'dual'
which.min(x)
## S4 method for signature 'dual'
which.max(x)
Arguments
x |
a dual object |
... |
extra arguments |
na.rm |
if 'TRUE', NA values are removed |
Details
For 'max' and 'min', the derivative is equal to the derivative of maximum element as identified by 'which.max' and 'which.min'. This is unfortunately problematic in presence of ties. If this is an issue, you may redefine this function (at the expense of speed).
Value
'which.min' and 'which.max' return an integer, the other methods return a dual object.
Examples
x <- dual( c(1,2,4) )
sum(x)
d(sum(x), "x1")
[Package salad version 1.0 Index]