Re: [R] create new column by replacing multiple unique values in existing column

2014-09-11 Thread John McKown
On Thu, Sep 11, 2014 at 10:49 AM, raz wrote: > Hi, > > I got the following data frame: > dat1 <- read.table(text="a,b > 1,A1 > 2,A1 > 3,A1 > 4,A1 > 5,A1 > 6,A2 > 7,A2 > 8,A2 > 9,A2 > 10,A2 > 11,B1 > 12,B1 > 13,B1 > 14,B1 > 15,B1",sep=",",header=T) > > > I would like to add a new column dat1$new b

Re: [R] create new column by replacing multiple unique values in existing column

2014-09-11 Thread David L Carlson
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of raz Sent: Thursday, September 11, 2014 10:49 AM To: r-help@r-project.org Subject: [R] create new column by replacing multiple unique values in existing column Hi, ​I got the following d

[R] create new column by replacing multiple unique values in existing column

2014-09-11 Thread raz
Hi, ​I got the following data frame: dat1 <- read.table(text="a,b 1,A1 2,A1 3,A1 4,A1 5,A1 6,A2 7,A2 8,A2 9,A2 10,A2 11,B1 12,B1 13,B1 14,B1 15,B1",sep=",",header=T) ​ ​I would like to add a new column dat1$new based on column "b" (dat$b) in which values will be substituted according to their un