Re: [R] Recode factors

2008-03-27 Thread Abhijit Dasgupta
; > >> -Original Message- >> From: Henrique Dallazuanna [mailto:[EMAIL PROTECTED] >> Sent: Thursday, March 27, 2008 12:50 PM >> To: Doran, Harold >> Cc: r-help@r-project.org >> Subject: Re: [R] Recode factors >> >> If I understand, y

Re: [R] Recode factors

2008-03-27 Thread Doran, Harold
Perfect. My headache is gone. Thanks. > -Original Message- > From: Henrique Dallazuanna [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 27, 2008 12:50 PM > To: Doran, Harold > Cc: r-help@r-project.org > Subject: Re: [R] Recode factors > > If I unde

Re: [R] Recode factors

2008-03-27 Thread Henrique Dallazuanna
If I understand, you can try this: levels(x)[is.na(as.numeric(levels(x)))] <- 0 On 27/03/2008, Doran, Harold <[EMAIL PROTECTED]> wrote: > I know this comes up, but I didn't see my exact issue in the archives. I > have variables in a dataframe that need to be recoded. Here is what I'm > dealing

[R] Recode factors

2008-03-27 Thread Doran, Harold
I know this comes up, but I didn't see my exact issue in the archives. I have variables in a dataframe that need to be recoded. Here is what I'm dealing with I have a factor called aa > class(aa) [1] "factor" > table(aa) aa *0123ABCDLNT 0