generate_date_periods: Generate a table with pairings of dates and periods

Description Usage Arguments

View source: R/generate-date-periods.R

Description

Generate a table with pairings of dates and periods

Usage

1
2
3
4
5
6
7
8
generate_date_periods(
  start,
  end,
  periods = c("day", "week", "month", "quarter", "year"),
  windows = c(7, 28, 56),
  intervals = FALSE,
  today_date = lubridate::today()
)

Arguments

start

Start date

end

End date

periods

A vector of calendar periods. This supports "day", "week", "month", "quarter", and "year".

windows

A vector of windows, each representing a # of days

intervals

Whether a preselected set of intervals starting from today, such as "Last Week", "Last 2 Weeks", or "All Time" should be included.

today_date

Date to count as "today": by default, lubridate::today().


datacamp/tidymetrics documentation built on March 21, 2021, 3:28 a.m.