Checks if a character string is made up of only spaces

is_blank(x)

Arguments

x

character vector to be checked for blank-ness

Examples

x <- c("red", "blue green", " ", " ", "", "yellow") is_blank(x)
#> [1] FALSE FALSE TRUE TRUE TRUE FALSE