cs_parse_month: Separate Coded Month

Description Usage Arguments Value Examples

View source: R/dates.R

Description

Separates a column containing coded year and coded month separated by "-" into two columns and removes the input column.

Usage

1
cs_parse_month(.data, var, yearVar, monthVar)

Arguments

.data

A tibble or data frame

var

the variable containing coded month and coded year

yearVar

the name of the column to contain the year data

monthVar

the name of the column to contain month data

Value

Returns a copy of the object with two new columns for the coded year and coded month appended to it.

Examples

1
2
3
4
5
6
# load example data
testData <- january2018

# parse CodedMonth
testData <- cs_parse_month(testData, var = coded_month, yearVar = reportYear,
    monthVar = reportMonth)

compstatr documentation built on July 8, 2020, 7:34 p.m.