TITLE(ifelse @@ Conditional Element Selection)
USAGE(
ifelse(test, yes, no)
)
ALIAS(ifelse)
DESCRIPTION(
LANG(ifelse) returns a value with the same shape as
LANG(test) which is filled with elements selected
from either LANG(yes) or LANG(no)
depending on whether the element of LANG(test)
is LANG(TRUE) or LANG(FALSE).
If LANG(yes) or LANG(no) are too short, their elements are recycled.
)
SEEALSO(
LANG(LINK(if)).
)
EXAMPLES(
x <- c(6:-4)
sqrt(x)#- gives warning
sqrt(ifelse(x >= 0, x, NA))# no warning
BLANK
## Note: the following also gives the warning !
ifelse(x >= 0, sqrt(x), NA)
)


