Rollapply: what does by.column do?
问题 I have read the description of by.column for rollapply in the manual but I couldn't understand how to use it. see below: 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 when i use by.column= FALSE : it applies mean to width (3) rolling number of lines mean(x[1:3,]) now, if I use by.column=TRUE then I get: x=matrix(1:60,nrow=10) rollapply(x,3,mean,fill=NA,align="right",by.column=TRUE) [,1] [,2] [,3] [,4] [,5] [,6