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

get_selection

Get the current selection available in a graph object


Description

Get the current selection of node IDs or edge IDs from a graph object of class dgr_graph.

Usage

get_selection(graph)

Arguments

graph

A graph object of class dgr_graph.

Value

A vector with the current selection of node or edge ID values.

Examples

# Create a simple graph
graph <-
  create_graph() %>%
  add_path(n = 6)

# Select node `4`, then select
# all nodes a distance of 1 away
# from node `4`, and finally
# return the selection of nodes as
# a vector object
graph %>%
  select_nodes(nodes = 4) %>%
  select_nodes_in_neighborhood(
    node = 4,
    distance = 1) %>%
  get_selection()

# Select edges associated with
# node `4` and return the
# selection of edges
graph %>%
  select_edges_by_node_id(
    nodes = 4) %>%
  get_selection()

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.