I have a large dataset [df] such as this:

```
id   device   date                pressure    warning
1    B3       2020-04-15 08:00    112         0
2    B3       2020-04-15 09:00    67          1
3    B3       2020-04-15 10:00    13          0
4    B3       2020-04-15 11:00    0           0
5    B3       2020-04-15 12:00    12          0
6    B3       2020-04-15 13:00    28          0
7    B3       2020-04-16 09:00    120         0
8    B3       2020-04-16 10:00    80          1
9    B3       2020-04-16 11:00    0           0
10   B3       2020-04-16 12:00    19          0
11   B3       2020-04-16 13:00    30          0

```

I need to select the ones which have a warning [1] and I also need to select the first row after a warning whith the pressure value higher than 20 [pressure >= 20].

The expected result would look like this:

```
id   device   date                pressure    warning
2    B3       2020-04-15 09:00    67          1
6    B3       2020-04-15 13:00    28          0
8    B3       2020-04-16 10:00    80          1
11   B3       2020-04-16 13:00    30          0

```

Is there any way of doing this in R or SQL?

Thank you for any suggestions.