I would like to subset my dataset based on a range. My date column is of type 'Date' and looks like this (monthly):
Date
1926-07-31
1926-10-31
1927-01-31
1927-04-30
From other forum posts (such as this one: Subsetting data.table set by date range in R) I have gathered a few approaches, none of which worked however:
df1 <- subset(df, Date > 1927-07-31 & Date < 1927-10-31)
df1<-df[df$Date>="1927-07-31" & df$Date<="1927-10-31"]
Is there a simple way of doing this (possibly without a new package)?