ifelse(test, yes, no)
ifelse
returns a value with the same shape as
test
which is filled with elements selected
from either yes
or no
depending on whether the element of test
is TRUE
or FALSE
.
If yes
or no
are too short, their elements are recycled.