is.fy: Convenience functions for dealing with financial years

Description Arguments Details Value Examples

View source: R/fy.year.R

Description

Convenience functions for dealing with financial years

Arguments

yr_ending

An integer representing a year.

fy.yr

A string suspected to be a financial year.

date

A string or date for which the financial year is desired. Note that yr2fy does not check its argument is an integer.

assume1901_2100

For yr2fy, assume that yr_ending is between 1901 and 2100, for performance. By default, set to getOption("grattan.assume1901_2100", TRUE).

Details

The following forms are permitted: 2012-13, 201213, 2012 13, only. However, the 2012-13 form is preferred and will improve performance.

Value

For is.fy, a logical, whether its argument is a financial year. The following forms are allowed: 2012-13, 201213, 2012 13, only. For fy.year, yr2fy, and date2fy, the financial year. For the inverses, a numeric corresponding to the year.

fy.year is a deprecated alias for yr2fy, the latter is slightly more efficient, as well as more declarative.

fy2yr converts a financial year to the year ending: fy2yr("2016-17") returns 2017. yr2fy is the inverse: yr2fy(fy2yr("2016-17")) == "2016-17".

fy2date converts a financial year to the 30 June of the financial year ending.

date2fy converts a date to the corresponding financial year.

Examples

1
2
3
4
5
is.fy("2012-13")
is.fy("2012-14")
yr2fy(2012)
fy2yr("2015-16")
date2fy("2014-08-09")

grattan documentation built on Oct. 17, 2018, 1:05 a.m.