Re: [R] Add column from other columns data.

2012-05-17 Thread Petr PIKAL
> Something along the lines of > > dat2 <- ifelse( dat1==1 , "yes", "no") Another option is in this case dat2 <- c("no", "yes")[dat1+1] Regards Petr > > should do it. > > John Kane > Kingston ON Canada > > > > -Original Message- > > From: s1010...@student.hsleiden.nl > > Sent:

Re: [R] Add column from other columns data.

2012-05-14 Thread Yellow
That worked. Thanks. :) -- View this message in context: http://r.789695.n4.nabble.com/Add-column-from-other-columns-data-tp4629921p4629937.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://sta

Re: [R] Add column from other columns data.

2012-05-14 Thread John Kane
Something along the lines of dat2 <- ifelse( dat1==1 , "yes", "no") should do it. John Kane Kingston ON Canada > -Original Message- > From: s1010...@student.hsleiden.nl > Sent: Mon, 14 May 2012 05:45:38 -0700 (PDT) > To: r-help@r-project.org > Subject: [R] Add column from other colu

Re: [R] Add column from other columns data.

2012-05-14 Thread Sarah Goslee
Assuming you actually have a data frame or matrix, and not a csv file, ifelse() is the general solution to your problem. Sarah On May 14, 2012, at 8:45 AM, Yellow wrote: > Hi everyone, > > I am having some problems with making a new colomn wit data in it. > I have this one column named: Ful