This function is a vectorized version of switch()
, that is, for
each element of input vector, switch()
is evaluated and the results are
combined.
vmap(EXPR, ..., SIMPLIFY = TRUE)
an expression evaluated to be character or numeric vector/list.
The list of alternatives for each switch()
.
TRUE
to simplify the resulted list to vector, matrix
or array if possible.