GetFYDate: Fiscal Date Generation

Description Usage Arguments Examples

Description

These functions take a vector of dates and return the fiscal year start or end dates.

Usage

1
2
3
GetFYStart(date, start.month = 7)

GetFYEnd(date, start.month = 7)

Arguments

date

Dates to be parsed

start.month

Starting month number of the fiscal year; defaults to 7 (July)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
(dts <- ToDate(paste("2012", 1:12, 1, sep="-")))

GetFYStart(dts)
GetFYEnd(dts)

GetFYStart(dts, start.month = 1)
GetFYEnd(dts, start.month = 1)
# Properly handles calendar years (i.e. no conversion)

GetFYEnd(dts, start.month = 3)
# Properly accounts for leap years

phively/wranglR documentation built on April 11, 2020, 5:12 a.m.