Re: [R] Recode of text variables

2009-04-01 Thread Gabor Grothendieck
doBy and memisc packages have recoding functions as well, e.g. > library(doBy) > x<-c("A","B","C","D","E","A") > out <- recodevar(x, list(c("A", "B"), c("C", "D", "E")), list("Treat 1", > "Treat 2")) > recodevar(x, list(c("A", "B"), c("C", "D", "E")), list("Treat 1", "Treat 2")) [1] "Treat 1" "Tr

Re: [R] Recode of text variables

2009-04-01 Thread John Fox
sure what recode(x, "1:2='A'; 3='B'") is supposed to do, inasmuch as x is a character, not numeric, vector. Thanks for bringing the bug to my attention. John > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.or

Re: [R] Recode of text variables

2009-04-01 Thread Bill.Venables
Original Message- From: Rolf Turner [mailto:r.tur...@auckland.ac.nz] Sent: Thursday, 2 April 2009 9:49 AM To: Venables, Bill (CMIS, Cleveland) Cc: andrew.mcfad...@maf.govt.nz; r-help@r-project.org Subject: Re: [R] Recode of text variables Uhhh, Bill, he wanted E to be recoded as ``Treat 3&

Re: [R] Recode of text variables

2009-04-01 Thread Rolf Turner
x27;s fascinating about Microsoft Access, but, uh... never mind. Yeah. ***Absolutely fascinating***. :-) Remind me to tell you sometime the story about the girl who went to finishing school in Switzerland R. Bill Venables http://www.cmis.csiro.au/bill.venables/ -Or

Re: [R] Recode of text variables

2009-04-01 Thread Rolf Turner
On 2/04/2009, at 12:22 PM, Andrew McFadden wrote: Hi all I am trying to do a simple recode which I am stumbling on. I figure there must be any easy way but haven't come across it. Given data of A","B","C","D","E","A" it would be nice to recode this into say three categories ie A and B becomes

Re: [R] Recode of text variables

2009-04-01 Thread Bill.Venables
ascinating about Microsoft Access, but, uh... never mind. Bill Venables http://www.cmis.csiro.au/bill.venables/ -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Andrew McFadden Sent: Thursday, 2 April 2009 9:23 AM To: r-help@r-proje

[R] Recode of text variables

2009-04-01 Thread Andrew McFadden
Hi all I am trying to do a simple recode which I am stumbling on. I figure there must be any easy way but haven't come across it. Given data of A","B","C","D","E","A" it would be nice to recode this into say three categories ie A and B becomes "Treat1", C becomes "Treat 2" and E becomes "Treat 3"