nice_month_string: nice_month_factor

View source: R/nice_date_functions.R

nice_month_stringR Documentation

nice_month_factor

Description

One of the problems with the Gregorian calendar is that months are not alphabetical. In R the default sorting of strings is in alphabetical order. For tables and graphs of data by month this may mean repeated creation of month variables, which is tedious.

Usage

nice_month_string(x, abbreviated_out = FALSE, year_type = "calendar")

Arguments

x

A month string, will take either abbreviated or full length month strings

abbreviated_out

Should the output be abbreviated? default = FALSE

year_type

string, either calendar or financial (year starts April)

Value

A factor with months in order as the occur in the year.

Examples

nice_month_string(x = "Dec", abbreviated_out = FALSE, year_type = "calendar")

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