nd.hamming {NetworkDistance} | R Documentation |
Hamming Distance
Description
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.
Usage
nd.hamming(A, out.dist = TRUE)
Arguments
A |
a list of length |
out.dist |
a logical; |
Value
a named list containing
- D
an
(N\times N)
matrix ordist
object containing pairwise distance measures.
References
Hamming RW (1950). “Error Detecting and Error Correcting Codes.” Bell System Technical Journal, 29(2), 147–160. ISSN 00058580.
Examples
## 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)
[Package NetworkDistance version 0.3.4 Index]