switchv: Vectorized version of switch (stolen from @kbroman)

Description Usage Arguments Value Examples

View source: R/z_deprecated.R

Description

Vectorized version of switch: just loops over input and calls switch.

Usage

1
switchv(EXPR, ...)

Arguments

EXPR

An expression evaluating to a vector of numbers of strings

...

List of alternatives

Value

Vector of returned values.

Examples

1
2
3
4
5
6
7
## Not run: 
switchv(c("horse", "fish", "cat", "bug"),
        horse="fast",
        cat="cute",
        "what?")

## End(Not run)

cole-brokamp/CB documentation built on May 13, 2019, 8:49 p.m.