I have the dataframe below:
dates <- data.frame(rep(
seq(as.Date('2017-01-01'), as.Date('2017-12-31'), by = 'days'),
times = 1))
colnames(dates)<-"day"
And I would like to subset it by the last 2 weeks. The thing is that I do not want to use something like:
dates[day>="2017-18-02"& day<="2017-05-02"]
because the dataframe will be updated over time and the last date will be changing.