Compares equality of all members of a list.
Usage
listOf(x, class, valid = TRUE)
Arguments
- x
A list.
- class
A character defining the expected class.
- valid
A logical defining if all elements should be
tested for validity. Default is TRUE.
Value
TRUE is all elements of x inherit from
class.
Examples
listOf(list(), "foo")
#> [1] TRUE
listOf(list("a", "b"), "character")
#> [1] TRUE
listOf(list("a", 1), "character")
#> [1] FALSE