View source: R/assignment_utils.R
is_mt_or_na | R Documentation |
If I want to check whether an element in a list is missing, sometimes it's
NA
, but sometimes it is simply a vector of length 0. This checks for both
possibilities.
is_mt_or_na(x)
x |
A vector of any type, of length 0 or 1 |
TRUE if the vector has length 0 or is NA
is_mt_or_na(character(0))
is_mt_or_na(NA_character_)
is_mt_or_na("foo")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.