title: Add country holidays to prophet model when using lists
body: <p>I wish to add US holidays to my data for modelling using the Facebook prophet function.</p>
  <p>I can add a predefined list of holidays i.e. NFL playoff and Super Bowl dates at model fitting time but it appears that country holidays need to be fit prior to model fitting.</p>
  <p>From the <a href="https://facebook.github.io/prophet/docs/seasonality,_holiday_effects,_and_regressors.html#built-in-country-holidays" rel="nofollow noreferrer">documentation</a> it shows that the country holidays are added to the prophet object and then fitted but I am unsure how to do this when using map as a data object (.x) needs to be specified when using map</p>
  <p>How can I add US holidays to my model using a list of data frames?</p>
  <p>This is what my code looks like so far:</p>
  <pre><code>#install.packages(&quot;pacman&quot;)
  #library(pacman)
  
  # LOAD LIBRARIES
  pacman::p_load(tidyquant,tidyverse,prophet,purrr)
  
  # SPECIFY STOCKS TO PULL
  tickers = c(&quot;AAPL&quot;,&quot;AMZN&quot;)
  
  # GET STOCK PRICE INFO
  getSymbols(tickers, 
             from = '2013-01-01',
             to = '2016-06-30',
             warnings = FALSE,
             auto.assign = TRUE)
  
  # MAP DATAFRAMES TO A LIST
  dfList &lt;- mget(tickers) %&gt;%
    map(~ fortify.zoo(.x) %&gt;% 
          select(1,5) %&gt;% 
    rename(ds = 1,
           y = 2))
  
  # SPECIFY NFL IMPORTANT DATES
  playoffs &lt;- tibble(
    holiday = 'playoff',
    ds = as.Date(c('2008-01-13', '2009-01-03', '2010-01-16',
                   '2010-01-24', '2010-02-07', '2011-01-08',
                   '2013-01-12', '2014-01-12', '2014-01-19',
                   '2014-02-02', '2015-01-11', '2016-01-17',
                   '2016-01-24', '2016-02-07')),
    lower_window = 0,
    upper_window = 1
  )
  superbowls &lt;- tibble(
    holiday = 'superbowl',
    ds = as.Date(c('2010-02-07','2011-02-06','2012-02-05','2013-02-03','2014-02-02','2015-02-01','2016-02-07','2017-02-05','2018-02-04','2019-02-03','2020-02-02')),
    lower_window = 0,
    upper_window = 1
  )
  
  holidays &lt;- bind_rows(playoffs, superbowls) %&gt;% 
    filter(ds &gt;= min(dfList$AAPL$ds) &amp; ds &lt;= max(dfList$AAPL$ds))
  
  # CALL THE PROPHET FUNCTION TO FIT THE MODEL
  model_list &lt;- map(dfList,
                    prophet, 
                    holidays = holidays)
  
  # TAKES THE MODEL ABOVE AND THE SPECIFIED FORECAST PERIOD TO PRODUCE A SUITABLE 
  # DATA FRAME
  future_list &lt;- map(model_list,
                     make_future_dataframe,
                     periods = 365)
  
  # USE THE GENERIC PREDICT FUNCTION TO GET OUR FORECAST
  forecast_list &lt;- map2(model_list,
                        future_list,
                        predict)
  </code></pre>