switchv: Vectorized version of switch

View source: R/switchv.R

switchvR Documentation

Vectorized version of switch

Description

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

Usage

switchv(EXPR, ...)

Arguments

EXPR

An expression evaluating to a vector of numbers of strings

...

List of alternatives

Value

Vector of returned values.

Examples

switchv(c("horse", "fish", "cat", "bug"),
        horse="fast",
        cat="cute",
        "what?")


broman documentation built on July 8, 2022, 5:07 p.m.

Related to switchv in broman...