My data frame looks like this:
id year value
1 2000 23
1 2001 40
1 2003 93
2 1998 90
2 1999 91
2 2002 92
3 2015 12
3 2016 13
3 2017 14
I want to remove the ID if there are any two consecutive values that do not meet the threshold of 90. Note: Consecutive in this case, just means 1 year after another year, does not have to be exactly 1 year after. (Example: 2001 and 2003 for ID 1 are consecutive years)
The output should be just id 2. If id 2 had any instances where two consecutive values were <90, they would also be removed.
id year value
2 1998 90
2 1999 91
2 2002 92