case: case - Performs a vectorized IF

Description Usage Arguments Details Value Author(s) Examples

Description

case Performs a vectorized IF

Usage

1

Arguments

...

A set of two sided formulas as LHS~RHS where LHS is logical and RHS is any closure

Details

case Performs a vectorized IF

Value

Nothing is returned the first case to evaluate as true will execute in the parent environment This function is purely used for its side effects.

Author(s)

Adam Wheeler adam.wheeler@thermofisher.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
case(
   grepl("[0-2]+\.[0-9]+\.[0-9]+","3.7.1") ~ {
     body <- list("a",
                  "b")
   },
   grepl("[3-9]+\.[0-9]+\.[0-9]+","3.7.1") ~ {
     body <- list("b",
                  "a")
   }
)

## End(Not run)

ajwtech/pfsrsdk documentation built on June 14, 2019, 10:34 a.m.