delete_node {DiagrammeR}R Documentation

Delete a node from an existing graph object

Description

From a graph object of class dgr_graph, delete an existing node by specifying its node ID.

Usage

delete_node(graph, node)

Arguments

graph

a graph object of class dgr_graph that is created using create_graph.

node

a node ID for the node to be deleted from the graph.

Value

a graph object of class dgr_graph.

Examples

## Not run: 
# Create an empty graph
graph <- create_graph()

# Add two nodes
graph <- add_node(graph, node = "a")
graph <- add_node(graph, node = "b")

# Delete a node
graph <- delete_node(graph, node = "a")

## End(Not run)

[Package DiagrammeR version 0.8.2 Index]