Re: [R] run function on subsets of matrix

2011-03-28 Thread fisken
Thanks, the drop=FALSE is bound to come in handy. And aggregate was indeed what I was looking. Thanks again 2011/3/27 David Winsemius : > > On Mar 27, 2011, at 3:22 AM, peter dalgaard wrote: > >> >> On Mar 27, 2011, at 08:25 , David Winsemius wrote: >> >>> >>> On Mar 26, 2011, at 10:26 PM, fiske

Re: [R] run function on subsets of matrix

2011-03-27 Thread David Winsemius
On Mar 27, 2011, at 3:22 AM, peter dalgaard wrote: On Mar 27, 2011, at 08:25 , David Winsemius wrote: On Mar 26, 2011, at 10:26 PM, fisken wrote: I was wondering if it is possible to do the following in a smarter way. I want get the mean value across the columns of a matrix, but I want

Re: [R] run function on subsets of matrix

2011-03-27 Thread peter dalgaard
On Mar 27, 2011, at 08:25 , David Winsemius wrote: > > On Mar 26, 2011, at 10:26 PM, fisken wrote: > >> I was wondering if it is possible to do the following in a smarter way. >> >> I want get the mean value across the columns of a matrix, but I want _along_ the columns, I assume. >> to do

Re: [R] run function on subsets of matrix

2011-03-26 Thread David Winsemius
On Mar 26, 2011, at 10:26 PM, fisken wrote: I was wondering if it is possible to do the following in a smarter way. I want get the mean value across the columns of a matrix, but I want to do this on subrows of the matrix, given by some vector(same length as the the number of rows). Something