Skip to content

quarter() function bug #682

@awfrankwils

Description

@awfrankwils

First, I would like to thank the authors @hadley @jiho @mmparker @zeehio @garrettgman for this package, and in particular the development of the quarter() function which does a great job of reducing the amount of code needed to generate FY and Quarter values. I would like to point out that there currently appears to be a bug in the way the quarter() function appends a fiscal year with_year.

Original example
x <- ymd(c("2012-03-26", "2012-05-04", "2012-09-23", "2012-12-31"))
quarter(x, with_year = TRUE, fiscal_start = 11)
[1] 2012.2 2012.3 2012.4 2013.1
This works fine with the december 2012 date reported as fiscal year 2013 Q1.

However if I move the fiscal start to April, we don't see similar treatment for fiscal year of the first date -- which should be 2011 Q4 based on this formatting.
quarter(x, with_year = TRUE, fiscal_start = 4)
[1] 2012.4 2012.1 2012.2 2012.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions