Hello,

If I understand it now, can't you do this:
Individual cases:
 list4<-list(mango[[1]],banana[[1]],pineapple[[1]])
b<-list()
 for(i in 1:3){
 b[[i]]<-list()
 b[[i]]<-lapply(list4[[i]],FUN=function(x)x[which.max(x)])
 }
b1<-data.frame(do.call(rbind,b))
row.names(b1)<-c("mango","banana","pineapple")
 b1
          coconut
mango           6
banana         18
pineapple       9
apply(b1,2, function(x) x[which.max(x)])
#$coconut
#$coconut$banana
#[1] 18

#This is what you asked for the result.
A.K.





______________________________________
If you reply to this email, your message will be added to the discussion below:
http://r.789695.n4.nabble.com/apply-function-over-same-column-of-all-objects-in-a-list-tp4638681p4638886.html
This email was sent by arun kirshna (via Nabble)
To receive all replies by email, subscribe to this discussion: 
http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=subscribe_by_code&node=4638681&code=ci1oZWxwQHItcHJvamVjdC5vcmd8NDYzODY4MXwtNzg0MjM1NTA4
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to