Hamming Distance is the count of discrepancy between two binary networks for each edge. Therefore, if used with non-binary networks, it might return a warning message and distorted results. It was originally designed to compare two strings of equal length, see Wikipedia page for more detailed introduction.
nd.hamming(A, out.dist =TRUE)
Arguments
A: a list of length N containing adjacency matrices.
out.dist: a logical; TRUE for computed distance matrix as a dist object.
Returns
a named list containing
D: an (N×N) matrix or dist object containing pairwise distance measures.
Examples
## load example data and extract only a fewdata(graph20)gr.small = graph20[c(1:5,11:15)]## compute distance matrixoutput = nd.hamming(gr.small, out.dist=FALSE)## visualizeopar = par(no.readonly=TRUE)par(pty="s")image(output$D[,10:1], main="two group case", axes=FALSE, col=gray(0:32/32))par(opar)