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
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
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&
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
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
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
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"
7 matches
Mail list logo