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

clear_selection

Clear an active selection of nodes or edges


Description

Clear the selection of nodes or edges within a graph object.

Usage

clear_selection(graph)

Arguments

graph

A graph object of class dgr_graph.

Value

A graph object of class dgr_graph.

Examples

# Create a graph with
# a single path
graph <-
  create_graph() %>%
  add_path(n = 5)

# Select nodes with IDs `1`
# and `3`
graph <-
  graph %>%
  select_nodes(
    nodes = c(1, 3))

# Verify that a node selection
# has been made
graph %>% get_selection()

# Clear the selection with
# `clear_selection()`
graph <-
  graph %>%
  clear_selection()

# Verify that the node
# selection has been cleared
graph %>% 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.