title: change date values in 1 list to ith date value from another list
body: <p>I have a sequence of dates</p>
  
  <pre><code>daysList &lt;- seq(as.Date('2016-12-29'),as.Date('2017-01-01'),by="days")
  </code></pre>
  
  <p>countList, a list with decremented value of daysList count from 0 to last value:</p>
  
  <pre><code>countList &lt;- list()
  for (i in (length(daysList)-1):0) {
  res &lt;- 0:i
  countList &lt;- append(countList, list(res))
  }
  </code></pre>
  
  <p>finally another list is generated, days_decremented, this list assigns values of dates in daysList to countList.</p>
  
  <pre><code>days_decrement &lt;- lapply(rev(seq_along(daysList)), tail, x=daysList)
  </code></pre>
  
  <p>I need to generate another list that changes values in days_decrement to repeat ith value in daysList.</p>
  
  <p>So the result would be something akin to:</p>
  
  <pre><code>&gt;daysCopy
  [[1]]
  [1] "2016-12-29" "2016-12-29" "2016-12-29" "2016-12-29"
  [[2]]
  [1] "2016-12-30" "2016-12-30" "2016-12-30"
  [[3]]
  [1] "2016-12-31" "2016-12-31"
  [[4]]
  [1] "2017-01-01"
  </code></pre>
  
  <p>I have tried a plethora of lapply, rep_len and even tried looping through the main days_decrement loop, assigning [[i]][i] values to daysList[i] values and I am getting nowhere.</p>
  
  <p>As usual I am missing an lapply implementation I think.</p>