Imputes missing date elements for start or end dates. Partial dates should be
in the format "UNKN-UN-UN" or some combination of those characters and
numbers (ie "2017-UN-UN"). Dates with no information or dates with a
missing year will be converted to NA. For start dates, missing days are
assumed to be the first of the month while missing months are assumed to be
January. For end dates, missing days are assumed to be the last day of the
month and missing months are assumed to be December.
Usage
impute_pdates(dates, ptype, input_sep = "-")
Value
a date vector of imputed dates in the format YYYY-MM-DD
Arguments
dates
a character vector of partial dates (which could also contain
full dates) in the format YYYY-MM-DD
ptype
a string of either "start" or "end" indicating whether start
or end dates should be imputed, respectively
input_sep
the character that separates date components in dates,
default is "-"