Re: [R] Counting unique items in a list of matrices

2010-10-09 Thread Jeffrey Spies
If you just want a list of matrices and their counts, you can use Peter's list of matrices, L, and then: With plyr: require(plyr) count(unlist(lapply(L, toString))) Without plyr: as.data.frame(table(unlist(lapply(L, toString Cheers, Jeff. On Sat, Oct 9, 2010 at 12:44 PM, Peter Ehlers wr

Re: [R] Counting unique items in a list of matrices

2010-10-09 Thread Peter Ehlers
On 2010-10-07 10:10, Jim Silverton wrote: Hello, I gave a list of 2 x 2 matrices called matlist. I have about 5000 2 x 2 matrices. I would like to count how many of each 2 x 2 unique matrix I have. So I am thinking that I need a list of the unique 2 x 2 matrices and their counts. Can anyone help

Re: [R] Counting unique items in a list of matrices

2010-10-07 Thread jcress410
I may or may not have the most elegant solution to this problem, but if it were me, I would probably put them all in a list and then unique_matrix_list <- unique(list_of_matrix) # number of unique matricies: length(unique_matrix_list) # count the number of each matrix, for (m in unique_ma

Re: [R] Counting unique items in a list of matrices

2010-10-07 Thread Jim Silverton
Hello, I gave a list of 2 x 2 matrices called matlist. I have about 5000 2 x 2 matrices. I would like to count how many of each 2 x 2 unique matrix I have. So I am thinking that I need a list of the unique 2 x 2 matrices and their counts. Can anyone help. -- Thanks, Jim. [[alternative H