title: For loop to get a range of dates R
body: <p>Hope you can help me out!
  For all of my dates in a column, I would like to get a range for each date - 14 days. So for example, if the first date in my column is 29-04-2021, I would like to get the dates from 15-04-2021 until 29-04-2021. I found the function seq that does this but to do this for all the values in my column I need to put the seq function in a for loop.
  This is what I tried but the output is only the last row and the date format changed. This is my code (test_IIVAC$'Vacdate  1' is my column with the dates):</p>
  <pre><code>df &lt;- data.frame()
   
  for(i in 1:length(test_IIVAC$`Vacdate  1`)){
      te  &lt;- as.Date(seq(test_IIVAC$`Vacdate  1`[i]-14, test_IIVAC$`Vacdate  1`[i], by = &quot;day&quot;))
      df1 &lt;- rbind(df, te)
  }
  </code></pre>
  <p>Can anyone help me out in getting the ranges of all the dates in the column and place them in one dataframe with the Date format? The desired output would be:</p>
  <p><a href="https://i.stack.imgur.com/V9IPy.png" rel="nofollow noreferrer">Output</a></p>
  <p>Thanks a bunch!</p>