label_year_range: Label special year type (like an academic or fiscal year),...

View source: R/label.R

label_year_rangeR Documentation

Label special year type (like an academic or fiscal year), which might span calendar years

Description

  • Special years are assumed to be "named" by the end year. Simply add one to your input if this is not the case. - This is intended to be used with ggplot2 like other labellers, e.g. scales::label_percent.

Usage

label_year_range(prefix = "", suffix = "", digits = NULL, ...)

Arguments

prefix

character, prefix to use for all labels (default: "")

suffix

character, suffix to use for all labels (default: "")

digits

integer, number of digits to use for second number in range (default: NULL, which indicates to guess)

...

not used

Value

function that takes an integer and returns a string

Examples

if (interactive()) {
  label_year_range(prefix = "FY ", digits = 4L)(2001:2010)
  label_year_range(prefix = "FY ")(2001:2010)
}

bvancilku/kubrand documentation built on July 26, 2022, 6:23 a.m.