switchv: switchv

View source: R/utils.r

switchvR Documentation

switchv

Description

Vectorized version of switch

Usage

switchv(EXPR, ...)

Arguments

EXPR

An expression evaluating to a vector of numbers of strings

...

List of alternatives

Details

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

Value

Vector of returned values.

Author(s)

Karl Broman

Examples

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

lukehannan/lumisc documentation built on May 9, 2022, 12:59 p.m.