title: Rollapply: what does by.column do?
body: <p>I have read the description of <code>by.column</code> for <code>rollapply</code> in the manual but I couldn't understand how to use it. see below:</p>
  
  <pre><code>x=matrix(1:60,nrow=10)
  
  library('zoo')
  rollapply(x,3,mean,fill=NA,align="right",by.column=FALSE)
  
       [1] NA NA 27 28 29 30 31 32 33 34
  </code></pre>
  
  <p>when i use <code>by.column= FALSE</code>: it applies mean to width (3) rolling number of lines <code>mean(x[1:3,])</code></p>
  
  <p>now, if I use <code>by.column=TRUE</code> then I get:</p>
  
  <pre><code>x=matrix(1:60,nrow=10)
  
  rollapply(x,3,mean,fill=NA,align="right",by.column=TRUE)
  
           [,1] [,2] [,3] [,4] [,5] [,6]
  
      [1,]  NA   NA   NA   NA   NA   NA
  
      [2,]  NA   NA   NA   NA   NA   NA
  
      [3,]  2   12   22   32   42   52
  
      [4,]  3   13   23   33   43   53
  
      [5,]  4   14   24   34   44   54
  
      [6,]  5   15   25   35   45   55
  
      [7,]  6   16   26   36   46   56
  
      [8,]  7   17   27   37   47   57
  
      [9,]  8   18   28   38   48   58
  
      [10,] 9   19   29   39   49   59
  </code></pre>
  
  <p>I can't make sense of the result. could anyone please explain what's the use of <code>by.column</code> and maybe provide an example?</p>