Re: [R] Compact Indicator Matrices

From: Douglas Bates <bates_at_stat.wisc.edu>
Date: Sun, 11 May 2008 08:47:10 -0500

On Sat, May 10, 2008 at 5:27 AM, amarkos <amarkos_at_gmail.com> 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 not sure exactly what you mean by a compact form of this matrix. 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?

In R indicator matrices are typically generated from a factor and essentially you are asking for the tabulation of the factor, such as provided by the functions table and xtabs.

> Is there an R function that deals with this problem or do I have to
> write it from scratch?
>
> Thanks,
> Angelos Markos
> Dr. Applied Informatics,
> University of Macedonia, Greece
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun 11 May 2008 - 13:53:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 11 May 2008 - 18:30:37 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive