These are generic parsers for year/quarter/month formats that work with
nearly all possible year/quarter formats. The only prerequisite is that
x contains a 4-digit-year and a 1-digit-quarter or 2-digit-month and no
additional numbers.
Usage
yq(x, quiet = FALSE)
qy(x, quiet = FALSE)
ym(x, quiet = FALSE)
my(x, quiet = FALSE)
Value
a date_yq or date_ym vector
Arguments
x
a character vector
quiet
a logical scalar. If TRUE warnings on parsing failures are
suppressed.
yq("2018 1")
qy("1st Quarter 2019")
#' # Works even for filenames, as long as they contain no additional numbersyq("business_report-2018_1.pdf")
my("business_report-082018.pdf")