Existy() returns TRUE or FALSE if an object exists or not. An object exists if it is not NULL or NA.

Existy(.x)

Arguments

.x

an object.

Value

a logical value.

See also

Other predicate functions: Truthy

Examples

# Some examples Existy(4) # TRUE
#> [1] TRUE
Existy("foo") # TRUE
#> [1] TRUE
Existy(NULL) # FALSE
#> [1] FALSE
Existy(NA) # FALSE
#> [1] FALSE
# Works with lists Existy(list(4, "foo", NULL, NA)) # TRUE
#> [1] TRUE
Existy(list(4, "foo")) # TRUE
#> [1] TRUE
Existy(list(NULL, NA)) # TRUE
#> [1] TRUE
Existy(list(NULL)) # TRUE
#> [1] TRUE
Existy(list(NA)) # FALSE
#> [1] FALSE
# Works with applying over lists lapply(list(4, "foo", NULL, NA), Existy) # TRUE, TRUE, FALSE, FALSE
#> [[1]] #> [1] TRUE #> #> [[2]] #> [1] TRUE #> #> [[3]] #> [1] FALSE #> #> [[4]] #> [1] FALSE #>