For work I need to find if a vector of dates falls on the week after Christmas. To do that, I thought the smartest first step would be to find the first day that falls in that period across the years I'm interested in. I've been able to use the method I'm using below for a number of holidays and special dates. This time however I've hit a wall in my understanding of how to work with dates. Please help me understand what I am doing wrong or what is happening under the surface to cause this error.
library(lubridate)
years_in_data <- 2008:2015
#Jan 1st
New_Years_Day <- ymd(paste0(years_in_data, "-01-01"), tz = "America/Anchorage")
#Dec. 26 - Dec. 31
Week_After_Christmas_start <- New_Years_Day + months(11) + day(25)
And the resulting error:
Error in as.POSIXlt.numeric(x, tz = tz(x)) : 'origin' must be supplied