Learn R Programming

smallstuff (version 1.0.3)

weight_distribution: Weight Distribution of a Graph

Description

Obtain the weight distribution of a graph, indicating for each strength from zero to the maximum strength of any vertex, the proportion of vertices with such a strength. This assumes positive integer weights.

Usage

weight_distribution(g, cumulative = FALSE, ...)

Value

A vector with the weighted degree distribution for the graph g.

Arguments

g

the graph (an igraph object)

cumulative

TRUE if cumulative weights are to be used; default is FALSE

...

additional parameters to be passed to the igraph function strength

Examples

Run this code
g=igraph::graph_from_literal(1-2,2-3:4,3-4:5:6,5-1)
igraph::E(g)$weight=c(1,2,1,4,2,1,1)
table(igraph::strength(g))/6
weight_distribution(g)

Run the code above in your browser using DataLab