nice_year: Nicely print a year in a given format

View source: R/nice_date_functions.R

nice_yearR Documentation

Nicely print a year in a given format

Description

Nicely print a year in a given format

Usage

nice_year(x, year_format)

Arguments

x

A year variable

year_format

The current format of x, one of "fyear6", "fyear4", "cyear2"

Value

A string formatted year

Examples

x <- 201516
nice_year(x, "fyear6")
nice_year(97, "cyear2")
nice_year(12, "cyear2")
nice_year("0708", "fyear4") # this fails - is it supposed to?
nice_year("07/08", "fyear4")

simonthelwall/nicethings documentation built on Feb. 27, 2023, 3:15 p.m.