I have a dataset as shown below
Col1 Col2 Col3 CutoffDate
12001 Yes 2008-08-15 2008-08-10
12001 Yes 2008-08-
And if you are using dplyr:
library(dplyr)
df <- data.frame(Col1 = c(12001, 12001, 12001, 12001),
Col2 = c("Yes", "Yes", "Yes", "Yes"),
Col3 = as.Date(c("2008-08-15", "2008-08-22", "2008-08-10", "2008-08-04")),
CutoffDate = as.Date(c("2008-08-10", "2008-08-10", "2008-08-10", "2008-08-10")))
df %>% filter(Col3 <= CutoffDate)