thanks very much for the help - all of these suggestions were much better
than what I was doing
--
View this message in context:
http://r.789695.n4.nabble.com/get-means-of-elements-of-5-matrices-in-a-list-tp2067722p2068329.html
Sent from the R help mailing list archive at Nabble.com.
__
On 2010-04-27 9:05, David Freedman wrote:
I've got a list of 5 matrices that are each 5 x 6. I'd like to end up with a
5 x 6 matrix that contains the mean value of the 5 original matrices. I can
do this by brute force, but there must be a better way than making each
matrix into a vector and th
On Apr 27, 2010, at 11:05 AM, David Freedman wrote:
I've got a list of 5 matrices that are each 5 x 6. I'd like to end
up with a
5 x 6 matrix that contains the mean value of the 5 original
matrices. I can
do this by brute force, but there must be a better way than making
each
matrix i
On Apr 27, 2010, at 10:19 AM, Marc Schwartz wrote:
> On Apr 27, 2010, at 10:05 AM, David Freedman wrote:
>
>>
>> I've got a list of 5 matrices that are each 5 x 6. I'd like to end up with a
>> 5 x 6 matrix that contains the mean value of the 5 original matrices. I can
>> do this by brute force
On Apr 27, 2010, at 10:05 AM, David Freedman wrote:
>
> I've got a list of 5 matrices that are each 5 x 6. I'd like to end up with a
> 5 x 6 matrix that contains the mean value of the 5 original matrices. I can
> do this by brute force, but there must be a better way than making each
> matrix i
Hi David,
Here is a suggestion:
matrix(colMeans(do.call(rbind, lapply(ll, function(x) as.vector(x, nrow
= length(ll))
HTH,
Jorge
On Tue, Apr 27, 2010 at 11:05 AM, David Freedman <3.14da...@gmail.com>wrote:
>
> I've got a list of 5 matrices that are each 5 x 6. I'd like to end up with
> a
I've got a list of 5 matrices that are each 5 x 6. I'd like to end up with a
5 x 6 matrix that contains the mean value of the 5 original matrices. I can
do this by brute force, but there must be a better way than making each
matrix into a vector and then remaking a matrix
thanks very much for a
7 matches
Mail list logo