Re: [R] Compact Indicator Matrices

2008-05-12 Thread amarkos
Thanks. It works! I think I found another solution, working straight with the indicator matrix. > count <- factor(table(apply(ind, 1, paste, collapse=""))) However, that way I can't store the indices of the collapsed rows. -Angelos Markos __ R-help@r

Re: [R] Compact Indicator Matrices

2008-05-11 Thread amarkos
On May 11, 4:47 pm, "Douglas Bates" <[EMAIL PROTECTED]> wrote: > Do you mean that you want to collapse similar rows into a single row > and perhaps a count of the number of times that this row occurs? Let me rephrase the problem by providing an example. Input: A = [,1] [,2] [1,]1

[R] Compact Indicator Matrices

2008-05-10 Thread amarkos
An indicator matrix is a binary matrix with orthogonal columns whose rows sum to 1. A row of this matrix could be [0 1 0 0]. My problem is to group the similar rows (profiles) so that to create a compact form of the matrix. Is there an R function that deals with this problem or do I have to write