Google search doesn't return much on this. How do you unpack arguments in R?
For instance if I try to use switch in R like
switch("AA",c("AA"=5,"BB"=6))
I will get back c("AA"=5,"BB"=6)
when in reality, I want 5.
Essentially, I want to be able to do switch("AA","AA"=5,"BB"=6)
with a vector mapping.