simplegraph (version 1.0.1)

degree: Degree of vertices

Description

Degree of vertices

Usage

degree(graph, mode = c("out", "in", "total", "all"))

Value

Named numeric vector of degrees.

Arguments

graph

Input graph.

mode

Whether to calculate out-degree, in-degree, or the total degree.

Examples

Run this code
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