How to split in R a date range into quarterly basis period? -


i want split monthly date range quarterly basis period. date variable built as.yearmonth:

> data$dates jul. 2014  ago. 2014 sep. 2014 ... ... jun. 2016 jul. 2016 ago. 2016 sep. 2016 

how should it? cut function works dates? don't want manually.

lubridate has quarter function. check out:

library(lubridate) x <- ymd(c("2012-03-26", "2012-05-04", "2012-09-23", "2012-12-31")) quarter(x) quarter(x, with_year = true) 

then thing have sort out date formats understood.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

c# SetCompatibleTextRenderingDefault must be called before the first -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -