View source: R/cluster-metrics.R
| layer_similarity_matrix | R Documentation |
Computes similarity matrix for all pairs of layers.
layer_similarity_matrix(
layers,
method = c("jaccard", "overlap", "cosine", "pearson")
)
lsim_matrix(layers, method = c("jaccard", "overlap", "cosine", "pearson"))
layers |
Named list of adjacency matrices (one per layer); at least two are required. |
method |
Comparison method: "jaccard" (default), "overlap", "cosine" or
"pearson". Note that |
A symmetric L x L matrix of pairwise similarities with the layer names as dimnames and 1 on the diagonal.
nodes <- c("A", "B", "C")
t1 <- matrix(c(0, 1, 0, 1, 0, 1, 0, 1, 0), 3, 3, dimnames = list(nodes, nodes))
t2 <- matrix(c(0, 1, 1, 1, 0, 0, 1, 0, 0), 3, 3, dimnames = list(nodes, nodes))
layers <- list(T1 = t1, T2 = t2)
layer_similarity_matrix(layers, "cosine")
layer_similarity_matrix(layers, "jaccard")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.