cosine_between_nodes: Estimate consine similarity between nodes in a graph

Description Usage Arguments Examples

View source: R/measurment_functions_NODES.R

Description

This function will calculate the cosine similarity between nodes at two time periods.

Usage

1
2
cosine_between_nodes(graph1, graph2, directed = FALSE, mode = "out",
  consider_zeros = FALSE, center = FALSE)

Arguments

graph1

first graph (igraph)

graph2

second graph (igraph)

directed

Boolean indicating if the graph is directed or not.

mode

For directed graphs this allows for in, out, or total cosine similarity to be calculated for each node. This argument is ignored for undirected graphs.

Examples

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_nodes(graph1,graph2)

tbonne/netTS documentation built on July 26, 2021, 2:27 a.m.