Description Usage Arguments Author(s) Examples
A vectorized version of switch
.
1 |
EXPR |
As in |
... |
Passed to |
Brendan Rocks rocks.brendan@gmail.com
1 2 3 4 5 6 7 8 9 10 11 | # The usual version of 'switch' works perfectly with one value
x <- "a"
switch(x, a = 1, b = 2, c = 3)
# But not with more than one
x <- letters[1:3]
## Not run: switch(x, a = 1, b = 2, c = 3)
# vswitch works well where you'd like to 'switch' a vector
x <- letters[1:3]
vswitch(x, a = 1, b = 2, c = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.