nd.hamming {NetworkDistance} | R Documentation |
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)
A |
a list of length |
out.dist |
a logical; |
a named list containing
an (N\times N)
matrix or dist
object containing pairwise distance measures.
Hamming RW (1950). “Error Detecting and Error Correcting Codes.” Bell System Technical Journal, 29(2), 147–160. ISSN 00058580.
## load example data and extract only a few
data(graph20)
gr.small = graph20[c(1:5,11:15)]
## compute distance matrix
output = nd.hamming(gr.small, out.dist=FALSE)
## visualize
opar = 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)