# NOT RUN {
is_empty("test")
is_empty("")
is_empty(NA)
is_empty(NULL)
# string is not empty
is_empty(" ")
# however, this trimmed string is
is_empty(trim(" "))
# numeric vector
x <- 1
is_empty(x)
x <- x[-1]
is_empty(x)
# check multiple elements of character vectors
is_empty(c("", "a"))
is_empty(c("", "a"), first.only = FALSE)
# empty data frame
d <- data.frame()
is_empty(d)
# empty list
is_empty(list(NULL))
# NA vector
x <- rep(NA,5)
is_empty(x)
is_empty(x, all.na.empty = FALSE)
# }
Run the code above in your browser using DataLab