Description Usage Arguments Value Examples
Convert a vector of dates or monthly data to the enclosing fiscal year. There are options to change the start of the fiscal year and choose from either numeric or label output.
1 | fiscal_year(x, start = 4, label = FALSE)
|
x |
A date vector or a vector of class |
start |
An integer between 1 and 12 representing the month on which the fiscal begins. The default gives April. |
label |
Should labels be returned instead of numeric years? If |
By default, a numeric vector of fiscal years or, if label = TRUE
, a
character vector of fiscal years.
1 2 3 4 5 6 | x <- seq.Date(as.Date("2012-01-01"), as.Date("2017-01-01"), by = "month")
fiscal_year(x) # April is the default starting month
fiscal_year(x, start = 7) # But this can be changed
fiscal_year(x, label = TRUE) # Label output may be attractive when publishing results
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.