title: Shifting multiple columns down by one row in R
body: <p>I have number of columns in my dataset and I need to shift columns 18:101 down by one row. So far, I found this command in another thread to be helfpul and below I apply it to my data: </p>
  
  <pre><code>data.xts$AR2_Forecast &lt;- transform(data.xts$AR2_Forecast, AR2_Forecast = c(NA, AR2_Forecast[-nrow(data.xts$AR2_Forecast)]))
  </code></pre>
  
  <p>However, since I have 83 additional columns, changing the names would be quite time-consuming. Is there anything I could use that would save me the time? </p>
  
  <p>I was thinking of something along the lines of: </p>
  
  <pre><code>data.xts[18:101]&lt;-
  </code></pre>
  
  <p>but I am not sure how the transform function should look.
  The class of my data is "xts", "zoo". </p>
  
  <p>Thanks for any feedback!</p>