Re: [R] Reassign Multiple Factors to same Factor Value

2013-03-25 Thread arun
[1] "a"      "b"      "c"  "d"  "others" A.K. From: Lorenzo Isella To: "r-h...@stat.math.ethz.ch" Sent: Monday, March 25, 2013 6:18 PM Subject: [R] Reassign Multiple Factors to same Factor Va

Re: [R] Reassign Multiple Factors to same Factor Value

2013-03-25 Thread soon yi
or just levels(df$y)[5:7]<-"others" Ista Zahn wrote > Hi Lorenzo, > > On Mon, Mar 25, 2013 at 6:18 PM, Lorenzo Isella > < > lorenzo.isella@ > > wrote: >> Dear All, >> Probably something very easy, but I am looking for the most efficient >> ways >> to achieve this. >> Consider the following sn

Re: [R] Reassign Multiple Factors to same Factor Value

2013-03-25 Thread Ista Zahn
Hi Lorenzo, On Mon, Mar 25, 2013 at 6:18 PM, Lorenzo Isella wrote: > Dear All, > Probably something very easy, but I am looking for the most efficient ways > to achieve this. > Consider the following snippet > > y<-c('a','b','c','d','e','f','g') > x<-rnorm(length(y)) > df<-data.frame(y,x) > > lea

[R] Reassign Multiple Factors to same Factor Value

2013-03-25 Thread Lorenzo Isella
Dear All, Probably something very easy, but I am looking for the most efficient ways to achieve this. Consider the following snippet y<-c('a','b','c','d','e','f','g') x<-rnorm(length(y)) df<-data.frame(y,x) leading to df$y [1] a b c d e f g Levels: a b c d e f g Now, I would like to repla