redhatqtr: Get a Red Hat quarter for a given date or vector of dates

Description Usage Arguments Details Value Examples

Description

Get a Red Hat quarter for a given date or vector of dates

Usage

1
redhatqtr(x = Sys.Date(), previous = FALSE, old = FALSE)

Arguments

x

The date-type value to be converted. Either a date, date-type string like '2016-04-25', or a yearmon using the zoo::as.yearmon() function.

previous

A logical scalar. Do you want the previous Red Hat quarter?

old

A logical scalar. Do you want the old Q%qFY%y format?

Details

The function can take muliple date types (see examples), and returns a Red Hat quarter.

Value

Returns a Red Hat quarter or vector or quarters. If old = TRUE, then returns the Red Hat quarter in the old Q%qFY%y format.

Examples

1
2
3
4
5
6
7
8
redhatqtr()
redhatqtr("2016-04-25")
y <- as.Date("2016-04-12")
redhatqtr(y)
z <- zoo::as.yearmon("2016-01-01")
redhatqtr(z)
redhatqtr(previous = TRUE)
redhatqtr(old = TRUE)

brascoball/hattyr documentation built on May 13, 2019, 2:30 a.m.