Lubridate: add `yq` for year-quarter parsing

Created on 16 Jun 2016  路  6Comments  路  Source: tidyverse/lubridate

Most helpful comment

Sure. Please open a new issue for this so we don't forget about it.

All 6 comments

Would this be a way having a posix-like object output from quarter()?

What do you have in mind more concretely? You don't have to use quarter to get time-stamps. You can use floor_date(..., unit = "quarter").

For parsing I indeed had in mind returning a Date object from strings like "2016.4".

Yes. I was hoping this would be something that takes a string like "2016.4" and gives it a date object.

It has been done

> yq("2014.1")
[1] "2014-01-01"

You also have a new format q that you can pass to parse_date_time and friends.

Could the usage for yq get added to the docs? Usage for this function isn't necessarily clear unless someone stumbles upon this issue.

Sure. Please open a new issue for this so we don't forget about it.

Was this page helpful?
0 / 5 - 0 ratings