isempty: 'Not Available' / Missing Values / Empty values / NULL

View source: R/isna.R

isemptyR Documentation

'Not Available' / Missing Values / Empty values / NULL

Description

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.

Usage

isempty(x, na = NULL)

Arguments

x

an R object to be tested

na

values can be treated as empty, default is NULL

Examples

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))

liubianshi/lbs documentation built on Nov. 2, 2023, 11:06 a.m.