powered by
ifthen(a, b, c, d, e, f, ...) == if (a) b else if (c) d else if (e) f
ifthen(a, b, c, d, e, f, ...)
if (a) b else if (c) d else if (e) f
ifthen(...)
ifelse returns the first value for which the corresponding statement evaluates to TRUE
ifelse
pairs of checks and corresponding return values
x <- 2 y <- 2 z <- 1 ifthen(x == 0, "foo", y == 0, "bar", z == 1, "this string gets returned")
Run the code above in your browser using DataLab