I have a .txt file
test.txt
V1 V2 Date
A B 2020-01-02
C D 2020-02-27
E F 2020-09-10
G H 2020-09-15
I want to subset data based on the most recent month. I did this which does the job but I want to extract the most recent month automatically rather than typing in manually and then extract the data
test$month <- factor(format(test$Date, "%B"),levels = month.name)
test.subset <- test[test$month == "September"]