With a selection of nodes in a graph, remove any edges to or from those nodes.

fully_disconnect_nodes_ws(graph)

Arguments

graph

a graph object of class dgr_graph.

Value

a graph object of class dgr_graph.

Examples

# Create an empty graph and # add a path of 6 nodes graph <- create_graph() %>% add_path(n = 6) # Select nodes `3` and `4` # and fully disconnect them # from the graph graph <- graph %>% select_nodes_by_id( nodes = 3:4) %>% fully_disconnect_nodes_ws() # Get the graph's edge data frame graph %>% get_edge_df()
#> id from to rel #> 1 1 1 2 <NA> #> 2 5 5 6 <NA>