degree: Degree of vertices

View source: R/basics.R

degreeR Documentation

Degree of vertices

Description

Degree of vertices

Usage

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

Arguments

graph

Input graph.

mode

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

Value

Named numeric vector of degrees.

Examples

G <- graph(list(A = c("B", "C"), B = "C", C = "A"))
degree(G, mode = "out")
degree(G, mode = "in")
degree(G, mode = "total")

simplegraph documentation built on Aug. 31, 2023, 9:07 a.m.