math ignore NA in math funs | R Documentation |
Simplifying math functions are simple wrappers of math function (- +). If any of the left-hand side or right-hand side is NA, Inf or NaN it returns any rational value, if there is any.
However, if the both values are irrational it returns NA. The result is then passed to the corresponding math function.
.x %minus_% .y
.x %plus_% .y
.x |
numeric or integer element |
.y |
numeric or integer element |
a single value
vignette("s")
, vignette("hablar")
## Not run: # The simplest case
3 %minus_% 2
# But with NA it returns 3 as if the NA were zero
3 %minus_% NA
# It doesnt matter if the irrational number is on left- or right-hand.
NA %plus_% 5
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.