I have a data frame on R and I want to remove all rows that are not increasing in my column 3. Each row have to be higher or equal than the previous one. But my main difficulty is that the rows have to increase according other columns 1 and 2. In my example, Column3 have to increase according Column1 [A-B] and 2 [1:4]. Here, Column1 [B] have to be removed because 199>197.
PS : It is CO2 measurements corresponding to many plots and date. When the CO2 measurments is not monotonous in the time, the measurement is wrong.
| Column1 | Column2 | Column3 |
|---|---|---|
| A | 1 | 200 |
| A | 2 | 202 |
| A | 3 | 204 |
| A | 4 | 207 |
| B | 1 | 199 |
| B | 2 | 197 |
| B | 3 | 200 |
| B | 4 | 202 |