Delete a node from an existing graph object
From a graph object of class dgr_graph
, delete an existing node by
specifying its node ID.
delete_node(graph, node)
graph |
A graph object of class |
node |
A node ID for the node to be deleted from the graph. |
A graph object of class dgr_graph
.
Other Node creation and removal:
add_n_node_clones()
,
add_n_nodes_ws()
,
add_n_nodes()
,
add_node_clones_ws()
,
add_node_df()
,
add_nodes_from_df_cols()
,
add_nodes_from_table()
,
add_node()
,
colorize_node_attrs()
,
copy_node_attrs()
,
create_node_df()
,
delete_nodes_ws()
,
drop_node_attrs()
,
join_node_attrs()
,
layout_nodes_w_string()
,
mutate_node_attrs_ws()
,
mutate_node_attrs()
,
node_data()
,
recode_node_attrs()
,
rename_node_attrs()
,
rescale_node_attrs()
,
set_node_attr_to_display()
,
set_node_attr_w_fcn()
,
set_node_attrs_ws()
,
set_node_attrs()
,
set_node_position()
# Create a graph with 5 nodes and # edges between each in a path graph <- create_graph() %>% add_path(n = 5) # Delete node with ID `3` graph <- delete_node(graph, node = 3) # Verify that the node with ID `3` # is no longer in the graph graph %>% get_node_ids() # Also note that edges are removed # since there were edges between the # removed node to and from other nodes graph %>% get_edges()
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.