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
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
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
3 matches
Mail list logo