reciprocity(graph, ignore.loops = TRUE, mode = c("default", "ratio"))
mode
argument is default
.Prior to igraph version 0.6, another measure was implemented, defined as the
probability of mutual connection between a vertex pair, if we know that
there is a (possibly non-mutual) connection between them. In other words,
(unordered) vertex pairs are classified into three groups: (1)
not-connected, (2) non-reciprocaly connected, (3) reciprocally connected.
The result is the size of group (3), divided by the sum of group sizes
(2)+(3). This measure is calculated if mode
is ratio
.
g <- sample_gnp(20, 5/20, directed=TRUE)
reciprocity(g)
Run the code above in your browser using DataLab