cmc_date: Convert Date to Century Month Code (CMC)

View source: R/data-survey.R

cmc_dateR Documentation

Convert Date to Century Month Code (CMC)

Description

Converts a date to DHS Century Month Code (CMC).

Usage

cmc_date(date)

Arguments

date

a Date vector

Details

CMC date is defined as the number of months since 1900:

cmc = (year - 1900) * 12 + momth

Value

an integer vector of CMC dates

References

https://dhsprogram.com/Data/Guide-to-DHS-Statistics/Organization_of_DHS_Data.htm?rhtocid=_4_2_0#Structure_of_DHS_Databc-1

Examples

cmc_date(Sys.Date())
cmc_date(as.Date("1987-02-11", format = "%Y-%m-%d"))


mrc-ide/naomi documentation built on April 10, 2024, 2:13 p.m.