Check whether the given list of character vectors contains a list of valid conditions.
Source:R/is_condition.R
is_condition.Rd
A valid condition is a character vector of predicates, where each predicate
corresponds to some column name of the related data frame. This function
checks whether the given list of character vectors x
contains only such predicates that can be found in column names of given
data frame data
.
Value
a logical vector indicating whether each element of the list x
contains a character vector such that all elements of that vector
are column names of data
Examples
d <- data.frame(foo = 1:5, bar = 1:5, blah = 1:5)
is_condition(list("foo"), d)
#> [1] TRUE
is_condition(list(c("bar", "blah"), NULL, c("foo", "bzz")), d)
#> [1] TRUE TRUE FALSE