get_degree_distribution: Get total degree distribution data for a graph

View source: R/get_degree_distribution.R

get_degree_distributionR Documentation

Get total degree distribution data for a graph

Description

Get degree distribution data for a graph. Graph degree is represented as a frequency of total degree values over all nodes in the graph.

Usage

get_degree_distribution(graph, mode = "total")

Arguments

graph

A graph object of class dgr_graph.

mode

using total (the default), degree considered for each node will be the total degree. With ⁠in⁠ and out the degree used will be the in-degree and out-degree, respectively.

Value

A data frame with degree frequencies.

Examples

# Create a random graph using the
# `add_gnm_graph()` function
graph <-
  create_graph(
    directed = FALSE) %>%
  add_gnm_graph(
    n = 10,
    m = 15,
    set_seed = 23)

# Get the total degree
# distribution for the graph
graph %>%
  get_degree_distribution(
    mode = "total")


DiagrammeR documentation built on June 22, 2024, 11:21 a.m.