nd_hamming function

Hamming Distance

Hamming Distance

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 NN 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)(N\times N) matrix or dist object containing pairwise distance measures.

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)

References

Rdpack::insert_ref(key="hamming_error_1950",package="NetworkDistance")

  • Maintainer: Kisung You
  • License: MIT + file LICENSE
  • Last published: 2021-08-21

Useful links