Re: [R] FW: Renaming levels of a factor in a dataframe

2011-08-15 Thread Ivan Calandra
You might want to compare the brackets in your code and in Tyler's Ivan Le 8/15/2011 16:36, B Jessop a écrit : Tyler, Tried your solution: levels (Data1$Site<- list(Fw = c("AB"), Est = c("DE"))) but still got a NULL response to str(Data1) and an alternating list of Fw, Est, Fw, Est unde

Re: [R] FW: Renaming levels of a factor in a dataframe

2011-08-15 Thread Bert Gunter
Well, it looks like the standard advice here applies to both poster and responder: try reading the Help (carefully): ?factor Example: > z <- factor(letters[1:3]) > z [1] a b c Levels: a b c > factor(z,labels=letters[4:6]) [1] d e f Levels: d e f > factor(z,labels=letters[3:1]) [1] c b a Levels: c

Re: [R] FW: Renaming levels of a factor in a dataframe

2011-08-15 Thread padmanabhan . vijayan
Try recode from Deducer package. Sent from my BlackBerry® smartphone from !DEA -Original Message- From: B Jessop Sender: r-help-bounces@r-project.orgDate: Mon, 15 Aug 2011 11:36:07 To: Subject: [R] FW: Renaming levels of a factor in a dataframe Tyler, Tried your solution: levels

[R] FW: Renaming levels of a factor in a dataframe

2011-08-15 Thread B Jessop
Tyler, Tried your solution: levels (Data1$Site <- list(Fw = c("AB"), Est = c("DE"))) but still got a NULL response to str(Data1) and an alternating list of Fw, Est, Fw, Est under Site when looked at in the Data editor in R console. The use of the "levels" function would seem to be appro