Skip to contents

Impute to the last day of the month/year

Usage

impute_lastday(date, dateaccuracy)

Arguments

date

Date. A vector of date.

dateaccuracy

chr. A vector of date accuracy ("Exact date", "Day uncertain", "Day/Month uncertain", "Estimated date")

Value

a date impute at the last day of the month/year depending on the accuracy.

Examples

impute_lastday(as.Date("2023-1-12"),"Day uncertain")
#> [1] "2023-01-31"