ternary operator just like java test ? yes : no

ifelse2(test, yes, no)

Arguments

test

an object which can be coerced to logical mode.

yes

return values for true elements of test.

no

return values for false elements of test.

Examples

x <- ifelse2(TRUE, 1:4, 1:10)