Say I have a numerical vector in R. And I want to see if a particular integer is present in the vector or not. We can do that easily in python using 'in' command and an if statement may be.
Do we have something similar in R as well? So that I don't have to use a for loop to check if the integer I want is present in a vector? I tried the following, but it does not seem to work. 'normal' is a dataframe and the second column has integers.
if (12069692 in normal[,2]) {print("yes")}
Says,
Error: unexpected 'in' in "if (12069692 in"