title: Evaluation error with RunMean and mutate
body: <p>Here's my code:</p>
  
  <pre><code>install.packages('TTR')
  library(dplyr)
  library(TTR)
  
  df &lt;- data.frame(index = 1:20, name = c("A", "B", "C", "A", "A", "C", "B", "C", "A", "B", "C", "A", "A", "A", "C", "B", "C", "A", "B", "D"), amount = c(10,14,3,4,15,9,12,6,7,8,10,13,12,6,8,8,9,3,14,10))
  
  all_data=data.frame()
  for (a in unique(df$name)){
  data=df%&gt;%filter(name==a)%&gt;%mutate(last3avg=runMean(amount, n = 3, cumulative = FALSE))  
  all_data=rbind(data,all_data)
  }
  
  all_data=all_data%&gt;%arrange(index)
  </code></pre>
  
  <p>And here's the error:</p>
  
  <blockquote>
    <p>Error in mutate_impl(.data, dots) : 
      Evaluation error: n = 3 is outside valid range: [1, 1].</p>
  </blockquote>
  
  <p>Why is this error happening and how can I fix it?</p>