end_of_period: End of period date

Description Usage Arguments Value Examples

View source: R/dateutils.R

Description

Return the date of the last day of the period (week, month, quarter, year). Weekly dates are indexed to Friday.

Usage

1
end_of_period(dates, period = c("month", "week", "quarter", "year"), shift = 0)

Arguments

dates

Date values formatted as.Date()

period

One of ''month'‘, '’week'‘, '’quarter'‘, '’year''.

shift

Integer, shift date forward (positive values) or backwards (negative values) by the number of periods.

Value

Last day of period in as.Date() format

Examples

1
end_of_period(as.Date("2019-09-15")) ## 2019-09-30

dateutils documentation built on Nov. 10, 2021, 5:09 p.m.