Skip to contents

Parse a "Mon YYYY" string to a Date

Usage

parse_monyear(x)

Arguments

x

Character vector like "Apr 2015" or "Mar 2020".

Value

A Date vector (first of each month).

Examples

parse_monyear("Apr 2015")
#> [1] "2015-04-01"
parse_monyear(c("Jan 2020", "Feb 2020", "Mar 2020"))
#> [1] "2020-01-01" "2020-02-01" "2020-03-01"