Skip to contents

Computes the betweenness of nodes in a graph that includes self-loops directly.

Usage

DNSL.betweenness(df,first.node = "V1",second.node = "V2")

Arguments

df

A data frame that should include at least two columns with the names of the nodes

first.node

The column that indicates the node that's linked

second.node

The column that indicates the other node that's linked

Details

This method computes betweenness centrality of a social network described by a data frame. Use it when you want to just apply the DNSLbetweenness method (Merelo and Molinari 2024) to a data set, without using the intermediate graph obtained by duplicating nodes.

Value

A list with betweenness values indexed by node name

References

Merelo JJ, Molinari MC (2024). “Intra-family links in the analysis of marital networks.” Journal of computational social science. doi:10.1007/s42001-023-00245-4 , https://link.springer.com/article/10.1007/s42001-023-00245-4.

Examples

library(igraph)
#> 
#> Attaching package: ‘igraph’
#> The following objects are masked from ‘package:stats’:
#> 
#>     decompose, spectrum
#> The following object is masked from ‘package:base’:
#> 
#>     union
V1 <- c("A", "A","B","C","D","E")
V2 <- c("A", "B","C","D","E","A")
print(DNSL.betweenness(data.frame(V1,V2)))
#>   A   B   C   D   E 
#> 0.5 2.0 1.0 1.0 2.0