Hi,

Does anyone know if the alternatives in the 'switch' function can be specified 
as strings containing spaces?  Neither of the two approaches below works.


switch(expr, "Choice 1"="My first choice", "Choice 2"="My 2nd choice", "Choice 
3"="My 3rd choice")


x <- c("Choice 1", "Choice 2", "Choice 3")
switch(expr, x[1]="My first choice", x[2]="My 2nd choice", x[3]="My 3rd choice")


If the intended functionality can be achieved by a different function(s), I'd 
most appreciate such a suggestion as well.

Many thanks,
Mauricio

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to