Description Usage Arguments Examples
View source: R/measurment_functions_GRAPH.R
This function will calculate the cosine similarity between two graphs.
1 2 | cosine_between_graphs(graph1, graph2, directed = FALSE,
considerZeros = TRUE, center = FALSE)
|
graph1 |
first graph (igraph) |
graph2 |
second graph (igraph) |
directed |
Whether the graph is directed or not (default = FALSE) |
considerZeros |
Whether to treat edges present in one graph, but not the other, as zero (TRUE), or consider only those edges present in both graphs (FALSE). |
center |
Whether to center the resulting vectors before measuring cosine similarity. |
1 2 3 4 5 | #two random graphs
library(igraph)
graph1 <-erdos.renyi.game(n=10,p=0.1)
graph2 <-erdos.renyi.game(n=10,p=0.1)
cosine_between_graphs(graph1,graph2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.