[R] incidence and adjacency matrix conversion

Philip Leifeld Philip.Leifeld at uni-konstanz.de
Thu Dec 7 16:55:51 CET 2006


Thanks, David. I tried converting my rectangular matrix to a network 
object and then back to a square matrix. This works for a small 
artificial dataset (e.g. 2x5), but when I try this on my 1790x45 or 
transposed 45x1790 matrix, R keeps working for a couple of minutes and 
then crashes completely without having saved any data first. I assume 
something is wrong with my data?

Cheers
Philip

David Barron wrote:
 > I think you can do this using the network package.  Look at the
 > as.network.matrix and as.matrix.network functions, for example.
 >
 >> how can I convert an m x n incidence matrix into an m x m adjacency
 >> matrix or an n x n adjacency matrix? The current matrix contains binary
 >> data, hence the new matrix would contain counts of common occurrences.




More information about the R-help mailing list