r - Forcing end of quarter date for as.Date(as.yearqtr()) -


as.yearqtr() zoo package appears use beginning of quarter:

library(zoo) x <- "2015-05-17" x <- as.date(x) x <- as.date(as.yearqtr(x)) x  # [1] "2015-04-01" 

how might instead grab end of quarter?

x  # [1] "2015-06-30" 

thanks!

use frac = 1 shown:

x <- as.date("2015-05-17") as.date( as.yearqtr(x), frac = 1 ) 

giving:

[1] "2015-06-30" 

Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -