DiagrammeR (version 0.9.0)

delete_edges_ws: Delete all selected edges in an edge selection

Description

In a graph object of class dgr_graph, delete all edges present in a selection.

Selections of edges can be performed using the following select_... functions: select_edges(), select_last_edge(), or select_edges_by_node_id(). Selections of edges can also be performed using the following traversal functions: trav_out_edge(), trav_in_edge(), or trav_both_edge().

Usage

delete_edges_ws(graph)

Arguments

graph

a graph object of class dgr_graph.

Value

a graph object of class dgr_graph.

Examples

Run this code
# NOT RUN {
# Create a graph
graph <-
  create_graph() %>%
  add_n_nodes(3) %>%
  add_edges_w_string(
    "1->3 1->2 2->3")

# Select edges attached to node with ID `3`
# (these are `1`->`3` and `2`->`3`)
graph <-
  graph %>%
  select_edges_by_node_id(3)

# Delete edges in selection
graph <-
  graph %>%
  delete_edges_ws()

# Get a count of edges in the graph
edge_count(graph)
#> [1] 1
# }

Run the code above in your browser using DataLab