Re: [R] Carrying a value down a data.frame conditionally

2014-12-24 Thread William Dunlap
A while ago I wrote for a questioner on this list a function, 'f1', below, that would give the start and stop times of runs of data that started when then the data went above a threshold and stopped when it first dropped below a different (lower) threshold). It used no loops and was pretty quick.

Re: [R] Carrying a value down a data.frame conditionally

2014-12-24 Thread peter dalgaard
> On 23 Dec 2014, at 23:57 , Pooya Lalehzari wrote: > > Hello, > I have a data.frame (below) containing the two fields of "Value" and "Signal" > and I would need to create the third field of "To_Be_Produced". The condition > for producing the third field is to carry the 1 in the "Signal" field

[R] Carrying a value down a data.frame conditionally

2014-12-23 Thread Pooya Lalehzari
Hello, I have a data.frame (below) containing the two fields of "Value" and "Signal" and I would need to create the third field of "To_Be_Produced". The condition for producing the third field is to carry the 1 in the "Signal" field down until "Value" is below 40. Do I have to create a for-loop