I\'ve got a little issue with the switch statement in R. The following code is OK ... :
value = \"B\" switch(value, \"A\"={ print(\"
Try using vapply.
vapply
i.e. in your case
vapply(mychr,switch,"",...SWITCH ARGS...)
I think what you would want is:
vapply(mychr,switch,"", mychr[1]=mychr[1],mychr[2]=mychr[2],mychr[3]=mychr[3],"Other !!!")