isempty | R Documentation |
In the actual data processing process, the appearance of a null value is either because it is not available, or because the value is invalid, or because it does not exist. Sometimes it is necessary to make a strict distinction, but in many cases, it is only necessary to judge whether a value is Empty value is sufficient.
isempty(x, na = NULL)
x |
an R object to be tested |
na |
values can be treated as empty, default is NULL |
x <- c("a", "b", "c", " ", "", NA, "#N/A", "--")
isempty(x)
isempty(x, "#N/A")
isempty(x, c("#N/A", "--"))
y <- c(1, 2, 3, 0, 8, NA, 99, NA, 99)
isempty(y)
isempty(y, 0)
isempty(y, c(0, 99))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.