mojquarter: Convert dates to publication quarters

View source: R/mojquarter.R

mojquarterR Documentation

Convert dates to publication quarters

Description

Convert dates as a string in "YYYY-MM-DD" format, with arbitrary separators, to either calendar or financial quarters. N.B. a financial year in the UK starts in April.

Usage

mojquarter(date, type = "c")

Arguments

date

A date as a string in the format "YYYY-MM-DD". Only last two digits for the year is also valid.

type

Either "c" or "f", to specify a calender quarter or a financial quarter. By default, the function outputs a calendar quarter.

Value

A character object.

Examples

mojquarter('2020-03-31', "f") # returns "2019q4"


moj-analytical-services/mojrap documentation built on July 30, 2023, 4:43 p.m.