deselect_edges: Deselect any selected edges in a graph

Description Usage Arguments Value Examples

View source: R/deselect_edges.R

Description

Deselect edges in a graph object of class dgr_graph.

Usage

1
deselect_edges(graph, edges)

Arguments

graph

A graph object of class dgr_graph.

edges

A vector of edge IDs that should be deselected.

Value

A graph object of class dgr_graph.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Create a graph with
# a single path
graph <-
  create_graph() %>%
  add_path(n = 5)

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

# Verify that an edge selection
# has been made
graph %>% get_selection()

# Deselect edge `1`
graph <-
  graph %>%
  select_edges_by_edge_id(
    edges = c(1, 3)) %>%
  deselect_edges(edges = 1)

# Verify that the edge selection
# has been made for edges `1` and
# `3` and that edge `1` has been
# deselected (leaving only `3`)
graph %>% get_selection()

DiagrammeR documentation built on July 2, 2020, 3:19 a.m.