i want vice versa, means where 1 it become zero, and where zero it becomes 1
actually i want to know is there any function in R so that we can find odd numbers.
There is an is.odd() function in the schoolmath package. The calculation you made would do basically the same thing. To invert the output, I would just use.
1 - y %% 2
Could you explain more about what you are trying to achieve? I am wondering about the need to invert your current calculation.