"Phil" == Philip Leifeld <Philip.Leifeld at uni-konstanz.de>
on Tue, 05 Dec 2006 22:30:02 +0100 writes:
Phil> Dear all,
Phil> how can I convert an m x n incidence matrix into an m x m adjacency
Phil> matrix or an n x n adjacency matrix? The current matrix contains binary
Phil> data, hence the new matrix would contain counts of common occurrences.
You have not given a self contained reproducible example
which would even be useful in such a case..
But just to be sure that the solution is not as simple as I
thought it was -- namely I thought, that for binary matrices,
crossprod() and tcrossprod() would give what you'd want :
n <- 10 ; m <- 4
set.seed(1)
M <- matrix(as.logical(rbinom(n*m, size=1, prob = 0.3)), n,m)
symnum(M)