I have a data frame in R magic query with one column with device id and the other with time. The time is in the format of 2013-05-02 09:20:12
The dataframe is in ascending order. I am trying to remove all rows where the time column, based on days only, is greater than X days from the row above it. 
Is there a way to apply this?
 
     
     
     
     
     
    