[R] sub-matrix block size

From: Santosh <santosh2005_at_gmail.com>
Date: Tue, 26 Apr 2011 17:13:31 -0700


Dear Rxperts

Below is a small vector of values of zeros and non-zeros... was wondering if there is an efficient way to get the block sizes of submatrices of a big matrix similar to the one shown below? diagonal elements can be zero too. Rows with only a diagonal element may be considered as a unit block size.

c(1,0,0,0,0,0,0,0,0,0,0,

   1,1,0,0,0,0,0,0,0,0,0,
   0,0,1,0,0,0,0,0,0,0,0,
   0,0,0,0,0,0,0,0,0,0,0,
   0,0,0,0,1,0,0,0,0,0,0,
   0,0,0,0,1,1,0,0,0,0,0,
   0,0,0,0,1,1,1,0,0,0,0,
   0,0,0,0,0,0,0,1,0,0,0,
   0,0,0,0,0,0,0,1,1,0,0,
   0,0,0,0,0,0,0,1,1,1,0,
   0,0,0,0,0,0,0,0,0,0,0)

Thanks much!
Santosh

        [[alternative HTML version deleted]]



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 Wed 27 Apr 2011 - 00:21:08 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 Wed 27 Apr 2011 - 06:40:34 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