I'm new to R, In my Frame data, I have col1 ("Timestamp"), col2 ("Values"). I need to delete rows from more than two consecutive NAs in col2. My dataframe is like the one below
Timestamp | values
-----------|--------
2011-01-02 | 2
2011-01-03 | 3
2011-01-04 | NA
2011-01-05 | 1
2011-01-06 | NA
2011-01-07 | NA
2011-01-08 | 8
2011-01-09 | 6
2011-01-10 | NA
2011-01-11 | NA
2011-01-12 | NA
2011-01-13 | 2
I would like to remove more than two duplicate rows based on the second column. Expected Result -
Timestamp | values
-----------|--------
2011-01-02 | 2
2011-01-03 | 3
2011-01-04 | NA
2011-01-05 | 1
2011-01-06 | NA
2011-01-07 | NA
2011-01-08 | 8
2011-01-09 | 6
2011-01-13 | 2
I am looking for a solution in advance.
source
share