title: dyShading R dygraph
body: <p>I am using the <code>dygraphs</code> package and I would like to add multiple shaded regions using the <code>dyShading</code> function. I would like not to have to specify manually the shaded region as it is done in the help of the function:</p>
  
  <pre><code>dygraph(nhtemp, main = "New Haven Temperatures") %&gt;% 
    dyShading(from = "1920-1-1", to = "1930-1-1") %&gt;%
    dyShading(from = "1940-1-1", to = "1950-1-1")
  </code></pre>
  
  <p>But instead, make a loop on the regions. It would look like something like that (that does not work!):</p>
  
  <pre><code>data %&gt;% dygraph()  %&gt;%
  for( period in ok_periods ) dyShading(from = period$from , to = period$to )
  </code></pre>
  
  <p>Do you have any ideas? Thanks you very much</p>