I would like to search and extract from a big dataframe in R a number that is located in different places but is always located one column and one row more than the word "LAYER".
I have tried to do it but I can only find a way to extract "LAYER" with a filter
using the dplyr
package but maybe I need to use something different.
For example, in the following table I would like to extract the 2 and the 3.65 that are bold in the dataframe.
X1 |
X2 |
X3 |
LAYER |
1 |
NA |
190 |
2 |
NA |
NA |
20 |
1200 |
NA |
30 |
2200 |
... |
... |
... |
LAYER |
2 |
NA |
180 |
3.65 |
NA |
NA |
50 |
1850 |
NA |
95 |
2300 |
... |
... |
... |
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…