Re: [R] request: most repeated component of a list

2008-09-12 Thread Jim Lemon
Muhammad Azam wrote: Thanks for the effort but still we are far from the desired result. May be this example will help you to understand the situation. Example a1=c(1:12); a1=array(a1,dim=c(3,4)); a2=c(1:12); a2=array(a2,dim=c(3,4)); a3=c(1:16) a3=array(a3,dim=c(4,4)); a=list(a1,a2,a3);

Re: [R] request: most repeated component of a list

2008-09-11 Thread Adam D. I. Kramer
mad Azam <[EMAIL PROTECTED]> Cc: R Help Sent: Thursday, September 11, 2008 9:53:40 AM Subject: Re: [R] request: most repeated component of a list That is indeed different from what I thought the first time. x <- sapply(1:length(l), function(x) { sum(sapply(l, function(y) { if ( nrow(

Re: [R] request: most repeated component of a list

2008-09-11 Thread Muhammad Azam
Thanks a lot for this effort. - Original Message From: Dimitris Rizopoulos <[EMAIL PROTECTED]> To: Muhammad Azam <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED]; R Help Sent: Thursday, September 11, 2008 10:52:16 AM Subject: Re: [R] request: most repeated component of a l

Re: [R] request: most repeated component of a list

2008-09-11 Thread Dimitris Rizopoulos
ed is >> >> [,1] [,2] [,3] [,4] [,5] >> [1,]40000 >> [2,]43400 >> [3,]43400 >> [4,]43 00 0Please help to find it. Thanks and >> >> best regards >> Muhammad Azam &

Re: [R] request: most repeated component of a list

2008-09-11 Thread Muhammad Azam
Subject: Re: [R] request: most repeated component of a list That is indeed different from what I thought the first time. x <- sapply(1:length(l), function(x) { sum(sapply(l, function(y) { if ( nrow(l[[x]]) != nrow(y) | ncol(l[[x]]) != ncol(y) ) FALSE else sum(y != l[[x]]) == 0

Re: [R] request: most repeated component of a list

2008-09-11 Thread Adam D. I. Kramer
ECTED]>; R Help Sent: Wednesday, September 10, 2008 5:59:28 PM Subject: Re: [R] request: most repeated component of a list If want you want is the summary from all of them, then 'rbind' the data together into one matrix and analyze it: totalMat <- do.call(rbind, listOfMatric

Re: [R] request: most repeated component of a list

2008-09-11 Thread Muhammad Azam
Azam - Original Message From: jim holtman <[EMAIL PROTECTED]> To: Muhammad Azam <[EMAIL PROTECTED]> Cc: R-help request <[EMAIL PROTECTED]>; R Help Sent: Wednesday, September 10, 2008 5:59:28 PM Subject: Re: [R] request: most repeated component of a list If want you w

Re: [R] request: most repeated component of a list

2008-09-10 Thread Adam D. I. Kramer
You might try apply(t(sapply(l,apply,2,sum)),2,sum) --Adam On Wed, 10 Sep 2008, Muhammad Azam wrote: Dear R community I have stored the results of arrays in a list consist of J-components (say 200 components). Each component containing same no of columns but may be different no of rows. e.

Re: [R] request: most repeated component of a list

2008-09-10 Thread jim holtman
If want you want is the summary from all of them, then 'rbind' the data together into one matrix and analyze it: totalMat <- do.call(rbind, listOfMatrices) On Wed, Sep 10, 2008 at 11:49 AM, Muhammad Azam <[EMAIL PROTECTED]> wrote: > Dear R community > I have stored the results of arrays in a list

[R] request: most repeated component of a list

2008-09-10 Thread Muhammad Azam
Dear R community I have stored the results of arrays in a list consist of J-components (say 200 components). Each component containing same no of columns but may be different no of rows. e.g [[1]] [,1] [,2] [,3] [,4] [,5] [1,]40000 [2,]43400 [3,