Re: [R] Compact Indicator Matrices

2008-05-12 Thread Douglas Bates
On Sun, May 11, 2008 at 9:49 AM, amarkos [EMAIL PROTECTED] wrote: 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

Re: [R] Compact Indicator Matrices

2008-05-12 Thread Douglas Bates
On Mon, May 12, 2008 at 11:27 AM, amarkos [EMAIL PROTECTED] wrote: Thanks, it works! Could you please provide the direct method you mentioned for the multivariate case? I'm not sure what you mean. I looked at what I wrote and I don't see anything that would fit that description. May I

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 __

Re: [R] Compact Indicator Matrices

2008-05-11 Thread Douglas Bates
On Sat, May 10, 2008 at 5:27 AM, amarkos [EMAIL PROTECTED] wrote: 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. I'm

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,]11

[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