Home > OS >  Sequence of dates for non-gregorian calendar in R
Sequence of dates for non-gregorian calendar in R

Time:08-25

I would like to get a sequence of dates for a year with 12 months- 30 days each (so no Gregorian calendar), and I am wondering if there is some workaround in seq.Date or seq.IDate (data.table). Thank you!

CodePudding user response:

  • We can try this
as.Date(paste0( "2022/",rep(1:12 , each = 30) ,"/", rep(1:30 , times = 12)))

CodePudding user response:

You could use ISOdate() to create date-times from numeric representations.

as.Date(ISOdate(2022, rep(1:12, each = 30), 1:30))
  • Related