Re: [R] Problem with the recode function

2010-06-16 Thread John Fox
Dear Alain, > -Original Message- > From: Alain Guillet [mailto:alain.guil...@uclouvain.be] > Sent: June-16-10 8:30 AM > To: John Fox > Cc: r-help@r-project.org > Subject: Re: [R] Problem with the recode function > > Dear John, > > Thanks a lot for the t

Re: [R] Problem with the recode function

2010-06-16 Thread Alain Guillet
ox wrote: Dear Alain, -Original Message- From: Alain Guillet [mailto:alain.guil...@uclouvain.be] Sent: June-15-10 12:25 PM To: John Fox Cc: r-help@r-project.org Subject: Re: [R] Problem with the recode function I found out what the problem is: when I start R Commander, so

Re: [R] Problem with the recode function

2010-06-15 Thread John Fox
Dear Alain, > -Original Message- > From: Alain Guillet [mailto:alain.guil...@uclouvain.be] > Sent: June-15-10 12:25 PM > To: John Fox > Cc: r-help@r-project.org > Subject: Re: [R] Problem with the recode function > > I found out what the problem is: when I star

Re: [R] Problem with the recode function

2010-06-15 Thread Dave Freedman
I find that sometimes the recode function in car is easier to use, while at other times it's easier to use the recode in Hmisc. If both packages are loaded, you can always use car::recode or Hmisc::recode to specify which function you want. hth, David Freedman, CDC -- View this message in conte

Re: [R] Problem with the recode function

2010-06-15 Thread Alain Guillet
I found out what the problem is: when I start R Commander, some plug-ins are automatically loaded and it seems that the problem comes from the RcmdrPlugin.Export, more precisely from the Hmisc package (the plug-in depends on it) which contains a recode() function too with the following document

Re: [R] Problem with the recode function

2010-06-15 Thread John Fox
r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Natalie Van Zuydam > Sent: June-15-10 11:59 AM > To: r-help@r-project.org > Subject: Re: [R] Problem with the recode function > > Dear Alain, > > Taking a stab in the dark here but I find

Re: [R] Problem with the recode function

2010-06-15 Thread Natalie Van Zuydam
Dear Alain, Taking a stab in the dark here but I find that if my original column is a factor then recode won't work for me. Would a simple ifelse statement not do the same thing? test$variable <- ifelse(test$x>=1 & test$x<=5,0,1) On 15/06/2010 16:53, John Fox wrote: Dear Alain, I'm afraid

Re: [R] Problem with the recode function

2010-06-15 Thread John Fox
Dear Alain, I'm afraid that I can't duplicate your problem. First, there is no recode function in the Rcmdr package; it uses recode from car. Here's a record of my Rcmdr session, using the recode dialog to generate the recode command: > test$variable <- recode(test$x, '1:5=0; else=1; ', as.fact