Get an element with condition that it must be from a list or vector
Source:R/language.R
grapes-OF-grapes.Rd
Get an element with condition that it must be from a list or vector
Examples
# C is from LETTERS, therefore returns `C`
"C" %OF% LETTERS
#> [1] "C"
# `lhs` is not from `rhs`, hence return the first element of LETTERS
'9' %OF% LETTERS
#> [1] "A"
NULL %OF% LETTERS
#> [1] "A"
# When there are multiple elements from `lhs`, select the first that
# matches the constraint
c('9', "D", "V") %OF% LETTERS
#> [1] "D"