Displaying 1 result from an estimated 1 matches for "flagfoehn3_durr".
2013 Jan 08
1
incrementation within ifelse
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 <<- ID ++
,
ID
)
,
0
)
What I am trying to do is to increment the ID when p$Guetsch == 0 and to
put this result in the column. The problem is that ID does not increment
itself.
An other way is to use...