format_period_month: Create consistent, complete one-month periods

Description Usage Arguments Details Value See Also Examples

View source: R/format_period.R

Description

Given a vector of period labels, create a factor that contains levels for the earliest and latest periods in x, and for all periods in between.

Usage

1

Arguments

x

A vector of period labels.

Details

The elements of x must all be single months, eg "2001 Feb" or "2055 Mar".

If x contains NA, then the levels of the factor created by format_period_month also contain NA.

Value

A factor with the same length as x.

See Also

Other functions for reformating period labels are

date_to_period_month creates month periods from dates.

Examples

1
format_period_month(x = c("2000 Sep", "2005 May", NA, "2004 Jan"))

johnrbryant/demprep documentation built on Dec. 31, 2021, 11:58 a.m.