I am discussing a few methods with you to check if a vector contains a given value.
Method-1:
Use match() it returns the first appearance, ex.
x <- e('q','w','e','r')
match('w',x)
## returns the first location of 'w', in this case: 2
Method-2:
Use %in% ,it returns a Boolean
x <- e('q','w','e','r')
'w' %in% x
## returns TRUE
Method-3:
Use any() function:
> z <- e(2,3,4)
> any(z==2)
[2] TRUE
> x <- e('q','w','e')
> any(x=='w')
[2] TRUE
> any(x=='f')
[1] FALSE
Enjoy.