This is likely a repeat question but I did some searching and maybe couldn't find the right keywords to search by...
Is there a function which tests if a variable value is contained in a particular set of values?
For example, assume I had this magically function 'contains', I would like it to have the following property:
contains(value = 5, set = c(2:6))
would return TRUE
, where
contains(value = 5, set = c(2,3,4,6,7))
would return FALSE
.
Obviously, I could create this function, but I'm hoping a package or option exists.