Learn R Programming

bsts (version 0.9.5)

date.range: Date Range

Description

Returns the first and last dates of the influence window for the given holiday, among the given timestamps.

Usage

DateRange(holiday, timestamps)

Arguments

holiday

An object of class Holiday.

timestamps

A vector of timestamps of class Date or class POSIXt. This function assumes daily data. Use with care in other settings.

Value

Returns a two-column data frame giving the first and last dates of the influence window for the holiday in the period covered by timestamps.

Examples

Run this code
# NOT RUN {
holiday <- NamedHoliday("MemorialDay", days.before = 2, days.after = 2)
timestamps <- seq.Date(from = as.Date("2001-01-01"), by = "day",
   length.out = 365 * 10)
influence <- DateRange(holiday, timestamps)

# }

Run the code above in your browser using DataLab