> a = c(5,7,2,9)
> b = ifelse(a %% 2 == 0,"even","odd")
# b: odd odd even odd
> a = c(5,7,2,9)
> ifelse(a %% 2 == 0,"even","odd")
[1] "odd" "odd" "even" "odd"
ifelse(test_expression, x, y)
> a = c(5,7,2,9)
> ifelse(a %% 2 == 0,"even","odd")
[1] "odd" "odd" "even" "odd"