| checkmissing | R Documentation |
The checkNULL() function efficiently checks for the presence
(or absence) of NULL in every element of a list.
The checkNA() function efficiently checks for the presence
(or absence) of NA/NaN in every element of an atomic vector.
checkNA(x, ...)
## Default S3 method:
checkNA(x, op, inv = FALSE, ...)
checkNULL(x, ...)
## Default S3 method:
checkNULL(x, op, inv = FALSE, ...)
x |
an object. |
... |
further arguments passed to or from methods. |
op |
a single string, giving the operation to use.
|
inv |
Boolean, indicating if the check should be inverted. |
Output depends on the specification of argument op:
"logical": logical vector with the same length, names, and dimensions as x.
"raw": raw vector with the same length, names, and dimensions as x.
"any": TRUE or FALSE.
"all": TRUE or FALSE.
"count" or "sum": 53 bit integer scalar.
"which": vector of indices.
"first": the first index found, or 0 otherwise.
"last": the last index found, or 0 otherwise.
# checkNA ====
x <- array(
sample(c(-10:10, NA, NaN)), dim = 4:2
)
y <- array(
sample(c(-10:10, NA, NaN)), dim = c(4,1,1)
)
broadcaster(x) <- broadcaster(y) <- TRUE
mx <- checkNA(x, "raw")
my <- checkNA(y, "raw")
bc.b(mx, my, "&")
bc.b(mx, my, "xor")
bc.b(mx, my, "nand")
bc.b(mx, my, "==")
bc.b(mx, my, "!=")
bc_ifelse(bc.b(mx, my, "|"), -1000L, x + y)
# checkNULL ====
x <- array(
sample(list(letters, LETTERS, month.abb, month.name, NULL)), dim = 4:2
)
y <- array(
sample(list(letters, LETTERS, month.abb, month.name, NULL)), dim = c(4,1,1)
)
broadcaster(x) <- broadcaster(y) <- TRUE
mx <- checkNULL(x, "raw")
my <- checkNULL(y, "raw")
bc.b(mx, my, "&")
bc.b(mx, my, "xor")
bc.b(mx, my, "nand")
bc.b(mx, my, "==")
bc.b(mx, my, "!=")
bc_ifelse(bc.b(mx, my, "|"), list(~ "Nothing"), bc.list(x, y, paste0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.