I'm trying to convert a table of holiday data into a calendar table with dummy variables per holiday, but I can't get that done. Hope someone can help. I've been searching StackOverflow for some time, tried with tidyr. but still can's get it done.
The idea is simple, I want to convert the following data:
holidays <- data.frame(holiday = c("a", "b", "c"),
datefrom = as.Date(c("1/1/2022", "1/2/2022", "1/3/2022"), format = "%d/%m/%y"),
dateto = as.Date(c("1/1/2022", "5/2/2022", "7/3/2022"), format = "%d/%m/%y"))
to this desired output:

Hope someone can help!