View source: R/betweenness.with.duplicated.nodes.R
betweenness.with.duplicated.nodes | R Documentation |
This is an implementation of the method published in the paper "Intra-family links in the analysis of marital networks" \insertCitemm24:intra_family_linksdupNodes, which proposed a duplication of nodes that includes self-loops to get a reflect better (and include all information about) the status of all nodes in the network, computing betweenness ignoring the duplicated nodes.
betweenness.with.duplicated.nodes(dup.graph)
dup.graph |
A graph object that has already duplicated nodes with self-loops. Essentially, it will recognize duplicated nodes as those with a prime at the end. Will not return betweenness value for these (it will be exactly the same as the other one). |
This method computes betweenness centrality in the regular way for the graph that includes duplicated nodes; it will only return values for the "original" nodes, however.
This object should be created with the function dup.nodes.from.data.frame
or dup.nodes.from.graph
A list with betweenness values indexed by node name.
library(igraph)
V1 <- c("A", "A","B","C","D","E")
V2 <- c("A", "B","C","D","E","A")
df <- data.frame(V1, V2)
dup.graph <- dup.nodes.from.data.frame(df)
print(betweenness.with.duplicated.nodes(dup.graph))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.