labnetmet-package: Library of distance metrics for labelled networks

Description Details Author(s) See Also Examples

Description

Provides several distance metrics that operate on small, directed, labelled networks.

Details

The DESCRIPTION file: This package was not yet installed at build time.

Index: This package was not yet installed at build time.

Calculate distances with hamming_dist, subgraph_dist or trans_dist to calculate distances between graphs (supplied as adjacency matricies). Hamming_dist will calculate the number of differences in direct edges between graphs. Subgraph_dist will calculate the number of subgraphs that differ. Trans_dist will calculate the number of paths that differ between the two graphs, such that the transitive closure of a graph is identical to the graph. Plots can be generated directly with plot_dist.

Author(s)

Helen Cook <helen.cook@cruk.cam.ac.uk>

Maintainer: Helen Cook <helen.cook@cruk.cam.ac.uk>

See Also

igraph

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
a1 <- matrix( c(0, 1, 1, 1,  0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0), nrow=4, ncol=4, byrow=TRUE)
dimnames(a1) <- list(c("A", "B", "C", "D"), c("A", "B", "C", "D"))

a2 <- matrix( c(0, 1, 1, 1,  0, 0, 1, 0,  0, 0, 0, 0,  0, 0, 0, 0), nrow=4, ncol=4, byrow=TRUE)
dimnames(a2) <- list(c("A", "B", "C", "D"), c("A", "B", "C", "D"))

labnetmet::hamming_dist(a1, a2)
labnetmet::subgraph_dist(a1, a2)
labnetmet::trans_dist(a1, a2)

a3 <- matrix( c(0, 0, 1, 1,  0, 0, 1, 0,  0, 1, 0, 0,  0, 0, 0, 0), nrow=4, ncol=4, byrow=TRUE)
dimnames(a3) <- list(c("A", "B", "C", "D"), c("A", "B", "C", "D"))

a4 <- matrix( c(0, 1, 0, 1,  0, 0, 1, 0,  0, 1, 0, 0,  1, 1, 1, 1), nrow=4, ncol=4, byrow=TRUE)
dimnames(a4) <- list(c("A", "B", "C", "D"), c("A", "B", "C", "D"))

l <- list(a1, a2, a3, a4)
generate_distances(l, trans_dist)

#labnetmet::plot_dist(l, trans_dist, "~/filename.pdf")

bitmask/labnetmet documentation built on Jan. 31, 2020, 2:48 a.m.