Learn R Programming

signnet (version 0.6.0)

pn_index: PN Centrality Index

Description

centrality index for signed networks by Everett and Borgatti

Usage

pn_index(g, mode = c("all", "in", "out"))

Arguments

g

igraph object. Must have a "sign" edge attribute.

mode

character string, <U+201C>out<U+201D> for out-pn, <U+201C>in<U+201D> for in-pn or <U+201C>all<U+201D> for undirected networks.

Value

centrality scores as numeric vector.

References

Everett, M. and Borgatti, S. (2014) Networks containing negative ties. Social Networks 38 111-120

Examples

Run this code
# NOT RUN {
library(igraph)
A <- matrix(c(0,  1,  0,  1,  0,  0,  0, -1, -1,  0,
              1,  0,  1, -1,  1, -1, -1,  0,  0,  0,
              0,  1,  0,  1, -1,  0,  0,  0, -1,  0,
              1, -1,  1,  0,  1, -1, -1,  0,  0,  0,
              0,  1, -1,  1,  0,  1,  0, -1,  0, -1,
              0, -1,  0, -1,  1,  0,  1,  0,  1, -1,
              0, -1,  0, -1,  0,  1,  0,  1, -1,  1,
             -1,  0,  0,  0, -1,  0,  1,  0,  1,  0,
             -1,  0, -1,  0,  0,  1, -1,  1,  0,  1,
              0,  0,  0,  0, -1, -1,  1,  0,  1,  0), 10, 10)
g <- igraph::graph_from_adjacency_matrix(A,"undirected",weighted = "sign")
pn_index(g)
# }

Run the code above in your browser using DataLab