Re: [R] lapply to subsets

2010-10-12 Thread Feng Li
Yes, that is what I what... Thanks. Feng On Wed, Oct 13, 2010 at 6:38 AM, Michael Bedward wrote: > Hello Feng, > > I think you just want this... > > lapply(A, function(x) apply(x[,,-c(1,2)], c(1,2), mean)) > > Michael > > > On 13 October 2010 04:00, Feng Li wrote: > > Dear R, > > > > I have a s

Re: [R] lapply to subsets

2010-10-12 Thread Michael Bedward
Hello Feng, I think you just want this... lapply(A, function(x) apply(x[,,-c(1,2)], c(1,2), mean)) Michael On 13 October 2010 04:00, Feng Li wrote: > Dear R, > > I have a silly question concerns with *apply. Say I have a list called A, > > A <- list(a  =  array(1:20, c(2, 2, 5)), b  = array(1