It is quite surprise to me that I could not find a ready answer for this question on stackoverflow.
In R, I have a vector of 0 and 1, and I wan
0
1
We can use !=
!=
c(0,1,1,0)!=0 #[1] FALSE TRUE TRUE FALSE