Re: [R] Applying function to elements of matrices in a list

2010-11-27 Thread statmobile
On 11/25/2010 10:30 AM, Peter Ehlers wrote: On 2010-11-25 07:06, statmobile wrote: On 11/25/2010 09:44 AM, Dimitris Rizopoulos wrote: try this: Reduce(+, x) / length(x) Thanks Dimitris, that's very slick, I was unaware of this Reduce function. The issue, is that I actually wanted to do a

[R] Applying function to elements of matrices in a list

2010-11-25 Thread statmobile
Hello R-help, Please cc me on all responses, as I only receive summary emails from this list. I'm wondering if anybody has any tips on how to accomplish this efficiently. I have a list of matrices, and I'm trying to get the mean of the [i,j]'th element of each matrix in a list. So if I

Re: [R] Applying function to elements of matrices in a list

2010-11-25 Thread Dimitris Rizopoulos
try this: Reduce(+, x) / length(x) Best, Dimitris On 11/25/2010 3:42 PM, statmobile wrote: Hello R-help, Please cc me on all responses, as I only receive summary emails from this list. I'm wondering if anybody has any tips on how to accomplish this efficiently. I have a list of matrices,

Re: [R] Applying function to elements of matrices in a list

2010-11-25 Thread statmobile
On 11/25/2010 09:44 AM, Dimitris Rizopoulos wrote: try this: Reduce(+, x) / length(x) Thanks Dimitris, that's very slick, I was unaware of this Reduce function. The issue, is that I actually wanted to do a trimmed mean, and if things prove possible even the median. Is there a way to apply

Re: [R] Applying function to elements of matrices in a list

2010-11-25 Thread Peter Ehlers
On 2010-11-25 07:06, statmobile wrote: On 11/25/2010 09:44 AM, Dimitris Rizopoulos wrote: try this: Reduce(+, x) / length(x) Thanks Dimitris, that's very slick, I was unaware of this Reduce function. The issue, is that I actually wanted to do a trimmed mean, and if things prove possible