powered by
dyad census with node attributes
dyad_census_attr(g, vattr)
dyad census as a data.frame.
igraph object. should be a directed graph.
name of vertex attribute to be used.
David Schoch
The node attribute should be integers from 1 to max(attr)
library(igraph) g <- sample_gnp(10, 0.4, directed = TRUE) V(g)$attr <- c(rep(1, 5), rep(2, 5)) dyad_census_attr(g, "attr")
Run the code above in your browser using DataLab