Existy: Tests the "existiness" of an object.

Description Usage Arguments Value See Also Examples

View source: R/Existy.R

Description

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

Usage

1
Existy(.x)

Arguments

.x

an object.

Value

a logical value.

See Also

Other predicate functions: Truthy

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Some examples
Existy(4) # TRUE
Existy("foo") # TRUE
Existy(NULL) # FALSE
Existy(NA) # FALSE

# Works with lists
Existy(list(4, "foo", NULL, NA)) # TRUE
Existy(list(4, "foo")) # TRUE
Existy(list(NULL, NA)) # TRUE
Existy(list(NULL)) # TRUE
Existy(list(NA)) # FALSE

# Works with applying over lists
lapply(list(4, "foo", NULL, NA), Existy) # TRUE, TRUE, FALSE, FALSE

paulhendricks/functools documentation built on May 24, 2019, 8:41 p.m.