Learn R Programming

bsts (version 0.9.10)

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)

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.

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.

Author

Steven L. Scott steve.the.bayesian@gmail.com

Examples

Run this code

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