Skip to contents

Find the middle of the month for a given date

Usage

mid_month(date)

Arguments

date

a vector of dates

Value

the middle day of the month the given dates fall in

Examples

date <- as.Date("2020-12-28")
mid_month(date)
#> [1] "2020-12-16"
mid_month(c("2019-02-15", "2020-03-08", "2010-06-01"))
#> [1] "2019-02-15" "2020-03-16" "2010-06-15"