powered by
Degree of vertices
degree(graph, mode = c("out", "in", "total", "all"))
Named numeric vector of degrees.
Input graph.
Whether to calculate out-degree, in-degree, or the total degree.
out
in
total
G <- graph(list(A = c("B", "C"), B = "C", C = "A")) degree(G, mode = "out") degree(G, mode = "in") degree(G, mode = "total")
Run the code above in your browser using DataLab