DiagrammeR (version 0.9.0)

select_last_node: Select last node in a series of node IDs in a graph

Description

Select the last node from a graph object of class dgr_graph. Strictly, this is the node encompassing the last record of the graph's node data frame. In practice, this will typically be the last node added to the graph.

Usage

select_last_node(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 an empty graph
graph <- create_graph()

# Add three nodes to the graph
graph <-
  graph %>%
  add_n_nodes(3)

# Select the last node added
graph <-
  graph %>%
  select_last_node()

# Get the current selection
graph %>% get_selection()
#> [1] 3
# }

Run the code above in your browser using DataCamp Workspace