calendar_month_factor: Convert a calendar to an ordered factor of month names

Description Usage Arguments Value Examples

View source: R/calendar.R

Description

calendar_month_factor() extracts the month values from a calendar and converts them to an ordered factor of month names. This can be useful in combination with ggplot2, or for modeling.

This function is only relevant for calendar types that use a month field, i.e. year_month_day() and year_month_weekday(). The calendar type must have at least month precision.

Usage

1

Arguments

x

[calendar]

A calendar vector.

...

These dots are for future extensions and must be empty.

labels

[clock_labels / character(1)]

Character representations of localized weekday names, month names, and AM/PM names. Either the language code as string (passed on to clock_labels_lookup()), or an object created by clock_labels().

abbreviate

[logical(1)]

If TRUE, the abbreviated month names from labels will be used.

If FALSE, the full month names from labels will be used.

Value

An ordered factor representing the months.

Examples

1
2
3
4
5

clock documentation built on Sept. 21, 2021, 5:10 p.m.