Skip to contents

One indicator per holiday, optionally widened by a window

Usage

holiday_matrix(t, holidays, lower = 0, upper = 0)

Arguments

t

Numeric vector of times.

holidays

Named list of dates per holiday.

lower

Integer, days before the holiday to flag.

upper

Integer, days after the holiday to flag.

Value

A list with matrix (list of rows) and names (sorted holiday names).

Examples

h <- holiday_matrix(t = 1:10, holidays = list(canada = 3, boxing = 8), lower = 1, upper = 1)
h$names
#> [1] "boxing" "canada"