title: How to add names to prophet plots with map2 in r?
body: <p>I'm making some forecasts with the prophet package  </p>
  
  <pre><code>library("tidyverse")
  library("lubridate")
  library("prophet")
  
  ds &lt;- dmy_hms("01.01.2016 0:00:00", "01.02.2016 0:00:00", "01.03.2016 0:00:00", "01.04.2016 0:00:00", "01.05.2016 0:00:00", "01.06.2016 0:00:00",
                "01.07.2016 0:00:00", "01.08.2016 0:00:00", "01.09.2016 0:00:00", "01.10.2016 0:00:00", "01.11.2016 0:00:00", "01.12.2016 0:00:00",
                "01.01.2017 0:00:00", "01.02.2017 0:00:00", "01.03.2017 0:00:00", "01.04.2017 0:00:00", "01.05.2017 0:00:00", "01.06.2017 0:00:00",
                "01.07.2017 0:00:00", "01.08.2017 0:00:00", "01.09.2017 0:00:00", "01.10.2017 0:00:00", "01.11.2017 0:00:00", "01.12.2017 0:00:00",
                "01.01.2018 0:00:00", "01.02.2018 0:00:00", "01.03.2018 0:00:00", "01.04.2018 0:00:00", "01.05.2018 0:00:00", "01.06.2018 0:00:00")
  
  y &lt;- c(899, 1178, 1586, 1717, 1166, 2113, 4136, 3096, 3379, 3229, 1814, 3207, 1173, 1036, 1361, 1179,1267, 2292, 3527, 3049, 3050, 3580, 2129, 2650, 1370, 1169, 1280, 1889, 1245, 2199)
  
  y1  &lt;- c(868, 882, 2274, 3390, 4781, 2803, 5545, 7226, 1526, 1748, 578, 1316, 833, 1199, 2447, 2465, 3601, 3165, 5828, 4590,  2692, 1549, 825, 1013, 1135, 962, 2057, 3437, 4689,3966)
  
  df1 &lt;- data.frame(ds, y, group = "group1" )
  
  df2 &lt;-  data.frame(ds, y = y1, group = "group2" )
  
  df &lt;- bind_rows(df1, df2)
  
  df_nested &lt;- df %&gt;% nest( - group) %&gt;%
    mutate(m = map(data, prophet, yearly.seasonality = TRUE)) %&gt;%
    mutate(future = map(m, make_future_dataframe, period = 7, freq = 'month')) %&gt;% 
    mutate(forcast = map2(m, future, predict))
  </code></pre>
  
  <p>after this, I'd like to make graphs for every forecast I've got, so I apply <code>map2</code> from <code>purrr</code> package: </p>
  
  <pre><code>map2(df_nested$m, df_nested$forcast, plot, ylab = df_nested$group)
  </code></pre>
  
  <p>So I get for the first plot <a href="https://i.stack.imgur.com/C8TZu.png" rel="nofollow noreferrer">group 1 forecast plot</a></p>
  
  <p>and for the second plot I've still the name "group1"</p>
  
  <p><a href="https://i.stack.imgur.com/Nvhaf.png" rel="nofollow noreferrer">group2 forecast</a></p>
  
  <p>How can I make the names of my plots to be the names of the groups?</p>