Use switch() as a conditional function with multiple conditions.
From R Help:
switch evaluates EXPR and accordingly chooses one of the
further arguments (in ...).
Usage
Arguments
EXPR an expression evaluating to a number or a character string.
... the list of alternatives, given explicitly.
Example:
> x=1
> switch(x,"a","b")
[1] "a"
Or combined with an if to test multiple conditions in one statement:
> x=1
> y="a"
> if(switch(x,"a","b")==y) cat("Match")
Match