get_degree_histogram {DiagrammeR} | R Documentation |
Get histogram data for a graph's degree frequency. The bin width is set to 1 and zero-value degrees are omitted from the output.
get_degree_histogram(graph)
graph |
a graph object of class
|
a named vector of degree counts (with bin width equal to 1) where the degree values serve as names.
# Create a random, directed graph with 18 nodes # and 22 edges graph <- create_random_graph( n = 18, m = 22, set_seed = 23) # Get degree histogram data for `random_graph` graph %>% get_degree_histogram() #> 0 1 2 3 4 #> 1 4 4 4 5