count complex triangles
Counts the number of all possible signed triangles (+++),(++-), (+--) and (---)
count_complex_triangles(g, attr)
g
: igraph object.attr
: edge attribute name that encodes positive ("P"), negative ("N") and ambivalent ("A") ties.counts for all complex triangle types
library(igraph) g <- make_full_graph(4) E(g)$type <- c("P", "N", "A", "A", "P", "N") count_complex_triangles(g, attr = "type")
signed_triangles
David Schoch
Useful links