what is error with the following code?
odd_even <-function(x)
{
{if (x %% 2 == 0) y <- TRUE
else y<-FALSE
}
y
}
odd_even(c((-5:5),2,-2))
it shows following answer
*[1] FALSE
Warning message:
In if (x%%2 == 0) y <- TRUE else y <- FALSE : the condition has length > 1 and only the first element will be used*