powered by
Get First or Last Day of Quarter From Year and Quarter
first_of_yq(x, q = NULL)last_of_yq(x, q = NULL)
last_of_yq(x, q = NULL)
a Date
Two integer (vectors). q is optional and the interpretation of x will depend on whether q is supplied or not:
q
x
if only x is supplied, x will be passed to as_date_yq() (e.g. x = 20161 means first quarter of 2016)
as_date_yq()
x = 20161
if x and q are supplied, x is interpreted as year and q as quarter.
first_of_quarter()
first_of_yq(2016, 1) first_of_yq(20161)
Run the code above in your browser using DataLab