Summary | R Documentation |
Methods extending to dual objects the corresponding methods for numeric objects.
## 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)
x |
a dual object |
... |
extra arguments |
na.rm |
if 'TRUE', NA values are removed |
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).
'which.min' and 'which.max' return an integer, the other methods return a dual object.
x <- dual( c(1,2,4) )
sum(x)
d(sum(x), "x1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.