Skip to content
Prev 276309 / 398506 Next

Reclassify string values

Hi Peter,

Thanks for the response. What you've suggested works fine but I'm 
looking for something that is simpler than my solution and avoids the 
pesky warning message. Your response avoids the warning message but just 
as complex (if not more). I just assumed there would be a function along 
the lines of:

 > mydata <- c("A", "C", "A", "D", "B", "B")
 > reclassify(mydata, inCategories=c("A", "B" ,"C", "D"),  
outCategories=c("Group1", "Group1", "Group2", "Group2"))

[1] "Group1" "Group2" "Group1" "Group2" "Group1" "Group1"

Zev
On 11/3/2011 3:13 PM, Peter Langfelder wrote: