View source: R/degree_balance.R
| degree_balance | R Documentation |
Computes and summarizes vertex degree distributions for an igraph
object. For directed graphs, the function reports in-degree and out-degree
statistics, including their correlation and mean values. For undirected
graphs, only overall degree statistics are reported.
degree_balance(g)
g |
An |
If the graph is directed (see igraph::is_directed()), the function:
Computes in-degree and out-degree for each vertex.
Prints summary statistics for both distributions.
Reports the correlation between in-degree and out-degree.
Reports mean in-degree and mean out-degree.
If the graph is undirected, the function:
Computes the degree for each vertex.
Prints summary statistics of the degree distribution.
A list containing:
out_degree Numeric vector of out-degrees (directed graphs only).
in_degree Numeric vector of in-degrees (directed graphs only).
degree Numeric vector of degrees (undirected graphs only).
library(igraph)
library(ig.degree.betweenness)
# Directed graph example
g_directed <- make_ring(10, directed = TRUE)
degree_balance(g_directed)
# Undirected graph example
g_undirected <- make_ring(10)
degree_balance(g_undirected)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.