How to remove more than 2 consecutive NA's in a column?
问题 I am new to R, In my data Frame I have col1("Timestamp"), col2("Values"). I have to remove rows of more than 2 consecutive NA in col2. My dataframe Looks like the below one, 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 2 duplicate rows based on second column. Expected output -