I have a data.frame column that looks like this
a$`1`
1 1316.100
2 0.200
3 131.600
4 0.500
5 49.600
6 0.500
7 183.100
8 0.200
9 1307.100
10 0.200
11 2.100
12 12.100
13 8.100
14 649.100
15 0.200
16 503.600
17 0.500
18 231.100
19 0.200
20 2527.600
21 0.500
22 90.100
23 0.200
The numbers before the decimals are seconds*100. The number after the decimal is an indicator value. I'm working on a fixed ratio choice task. In which, a correct choice (marked by ".100") or an incorrect choice (marked by ".600" and always followed by "0.500") can occur. If a correct choice is chosen and a reward is given (marked by the ".100" followed by "0.200") then a timeout period occurs for 10 seconds. During that time, choices can be made (marked by ".100" or ".600"/"0.500")but no reward is given until the timeout period is over.
The problem is that I have no indication of when a timeout occurred.
How can I add indicator values for the timeout period? For example, place a "0.700" value after every "0.200" value to mark the start of timeout. Then place a "0.800" value after 10 seconds to mark the end of a timeout.
Edit: I guess a for lop would come in handy here? I want to sum the values after every 0.200 value. Once the sum of the row values exceeds 10 seconds, place a 0.800 value and then continue on to the next 0.200 value. Finally, after every 0.200, place a 0.700. The 0.700 will mark a timeout start and the 0.800 will mark a timeout (10 second) stop. This is what my column should look like...
a$`1`
1316.100
0.200
0.700
131.600
0.500
49.600
0.500
0.800
183.100
0.200
0.700
0.800
1307.100
0.200
0.700
2.100
12.100
8.100
0.800
649.100
0.200
0.700
0.800
503.600
0.500
231.100
0.200
0.700
0.800
2527.600
0.500
90.100
0.200