Description Usage Arguments Value Examples
This (vectorized) function returns the first
non-NA
argument, similar to the SQL function
COALESCE
. If a vector or matrix is passed as first argument,
the remaining arguments are recycled to generate a vector/matrix of
the same dimension, and coalescing is done element by element.
1 | coalesce.na(x, ...)
|
x |
The first value to coalesce. |
... |
Other values to coalesce. |
A vector of the same length as x
.
1 2 3 4 5 | coalesce.na(NA, -1)
coalesce.na(5, 3)
coalesce.na(c(1,NA,NA), c(NA,2))
coalesce.na(matrix(c(NA, 1:3), nrow=2))
coalesce.na(NA)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.