degree: Degree of vertices

Description Usage Arguments Value Examples

View source: R/basics.R

Description

Degree of vertices

Usage

1
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

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

MangoTheCat/simplegraph documentation built on May 7, 2019, 2:23 p.m.