title: rollapply outputing two or more columns
body: <p>I am trying to use rollapply so that I only use it once, rather than multiple times and then merging the results. The idea being that I want to get multiple bits of data from an <code>xts</code> object. In the below mock example I would like to be able to get the sum and the maximum value of the sliding window.</p>
  
  <pre><code>require(xts)
  v &lt;- xts(rnorm(100),Sys.Date()-100:1)
  rollapply(v,width=10,function(y){c(sum(y),max(y))})
  </code></pre>
  
  <p>This leads to the following error...</p>
  
  <pre><code>Error in xts(xx, tt, if (by == 1) attr(data, "frequency")) : 
    NROW(x) must match length(order.by)
  </code></pre>
  
  <p>The below is the sessionInfo I was running:</p>
  
  <pre><code>R version 2.15.2 (2012-10-26)
  Platform: i386-apple-darwin9.8.0/i386 (32-bit)
  
  locale:
  [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] xts_0.9-3 zoo_1.7-9
  
  loaded via a namespace (and not attached):
  [1] grid_2.15.2     lattice_0.20-10
  </code></pre>
  
  <p>I thought I had this figured out, before but clearly not....</p>