There are various ways to do this-
It can be done using the match () function- match () function returns the first appearance of a particular element.
The other is to use %in% which returns a Boolean value either true or false.
Is.element () function also returns a Boolean value either true or false based on whether it is present in a vector or not.