I have a dataset as shown below
Col1 Col2 Col3 CutoffDate
12001 Yes 2008-08-15 2008-08-10
12001 Yes 2008-08-22 2008-08-10
12001 Yes 2008-08-10 2008-08-10
12001 Yes 2008-08-04 2008-08-10
I am only interested in retaining the last two rows because they are less than or equal to the Cutoff Date 2008-08-10.
The final dataset should look like this
Col1 Col2 Col3 CutoffDate
12001 Yes 2008-08-10 2008-08-10
12001 Yes 2008-08-04 2008-08-10
I know the subset function in R but not sure how to do this , any help is much appreciated.