PS : use a single = instead of a double. It's an assignment you do,
not a comparison.
Cheers
Joris
On Wed, Jun 9, 2010 at 2:14 PM, Joris Meys wrote:
> R is confused about the type in the switch, reads it as numeric
> instead of a character. Try :
> temp1.name <- switch(temp1,
>
R is confused about the type in the switch, reads it as numeric
instead of a character. Try :
temp1.name <- switch(temp1,
"1" = "aa",
"2" = "bb",
"3" = "cc",
Hi all, Here I am trying to implement the switch() function to choose value of
a variable depending on the value of an input variable :
temp1 <- "1"
temp1.name <- switch(temp1,
1 == "aa",
2 == "bb",
3 matches
Mail list logo