I would like to find the number of quarters dynamically from the date "03/31/2018". I have tried this to get 20th quarters. Similar way need to get other quarter numbers(e.g., 21 and 22) when data period increase.
as.numeric(as.Date("2018-03-31"))
# > [1] 17621
floor(as.numeric(Sys.Date()-17621)/92)-1
# > [1] 20
How can I edit the code above to get 21 and 22 dynamically when data period increases?