Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get_eccentricity

Get node eccentricities


Description

Get a data frame with node eccentricity values.

Usage

get_eccentricity(graph, mode = "out")

Arguments

graph

A graph object of class dgr_graph.

mode

the mode with which the shortest paths to or from the given vertices should be calculated for directed graphs. If out (the default) then the shortest paths from the node, if in then only shortest paths to each node are considered. If all is used, then the corresponding undirected graph will be used and edge directions will be ignored. For undirected graphs, this argument is ignored.

Value

A data frame containing eccentricity values by node ID value.

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 eccentricity values for
# all nodes in the graph
graph %>% get_eccentricity()

DiagrammeR

Graph/Network Visualization

v1.0.6.1
MIT + file LICENSE
Authors
Richard Iannone [aut, cre] (<https://orcid.org/0000-0003-3925-190X>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.