How can I convert the following vector in R to an as.Date format?
date= c( "2023-Q3" ,"2021-Q1", "2017-Q1", "2009-Q1", "2001-Q1", "1988-Q4")
How can I convert the following vector in R to an as.Date format?
date= c( "2023-Q3" ,"2021-Q1", "2017-Q1", "2009-Q1", "2001-Q1", "1988-Q4")
Copyright © 2021 Jogjafile Inc.
Use the
yq
function from lubridate. This will give you the first date of the first month of the quarter