get_eccentricity {DiagrammeR} | R Documentation |
Get a named vector or data frame with node eccentricity values.
get_eccentricity(graph, nodes = NULL, return_type = "vector")
graph |
a graph object of class
|
nodes |
an optional vector of node IDs for filtering the list of nodes present in the graph. |
return_type |
using |
a data frame containing metrics pertaining to the graph.
# Get the eccentricities for all nodes in # a randomly-created graph get_eccentricity( graph = create_random_graph( 15, 20, set_seed = 20)) #> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #> 5 8 2 7 1 1 7 7 1 6 2 2 8 7 9