Re: [R] incrementation within ifelse

2013-01-09 Thread Adams, Jean
Damien, You don't give an example of what your data frame looks like or what you want the new column to look like (given that example data), but I created an example data frame for z, and wrote a few lines of code to add a new column. Check it out and see if it comes close to doing what you want.

[R] incrementation within ifelse

2013-01-08 Thread Damien Pilloud
Dear R-helper, I am working on a very large data frame and I am trying to add a new column and write in it with certain conditions. I have try to use this code with the data frame p : ID = 0 p[,"newColumn"]<- ifelse (p$flagFoehn3_durr == 1, ifelse(p$Guetsch == 0, ID <<- I