There are many ways to do this, this simple example would be one of them and could work as a REPRoducible EXample (reprex) for your question.
holidays <- c("01-01", "31-12")
df <- data.frame(stringsAsFactors = FALSE,
date = c("01-01-2019", "07-31-2019", "12-31-2019",
"01-01-2018", "07-31-2018", "12-31-2018"))
library(dplyr)
library(lubridate)
library(stringr)
df %>%
mutate(date = mdy(date),
dummy = if_else(paste(str_pad(day(date), 2, pad = "0"),
str_pad(month(date), 2, pad = "0"),
sep = "-") %in% holidays, 1, 0))
#> date dummy
#> 1 2019-01-01 1
#> 2 2019-07-31 0
#> 3 2019-12-31 1
#> 4 2018-01-01 1
#> 5 2018-07-31 0
#> 6 2018-12-31 1
Created on 2019-06-17 by the reprex package (v0.3.0)