ifthen: Shortcut for multiple if else statements

View source: R/check.R

ifthenR Documentation

Shortcut for multiple if else statements

Description

ifthen(a, b, c, d, e, f, ...) == if (a) b else if (c) d else if (e) f

Usage

ifthen(...)

Arguments

...

pairs of checks and corresponding return values

Value

ifelse returns the first value for which the corresponding statement evaluates to TRUE

Examples

x <- 2
y <- 2
z <- 1
ifthen(x == 0, "foo", y == 0, "bar", z == 1, "this string gets returned")

toscutil documentation built on June 28, 2024, 5:06 p.m.

Related to ifthen in toscutil...