title: How to calculate 7-day moving average in R?
body: <p>I'm using the <code>rollmean</code> function of <code>zoo</code> package to calculate a simple 7-day moving average. The function has an argument <code>align</code> and if I put "right", "center" or "left" it changes the values. What's the difference between them?</p>
  
  <p>Example code:</p>
  
  <pre><code>test &lt;- sample(1:50)
  data &lt;- rollmean(test, 7, fill = list(NA, NULL, NA), align = "right")
  
  test &lt;- cbind(test, data)
  </code></pre>