is_graph_empty {DiagrammeR} | R Documentation |
Provides a logical value on whether the graph is empty (i.e., contains no nodes).
is_graph_empty(graph)
graph |
a graph object of class |
a logical value.
## Not run: # Create an empty graph graph <- create_graph() # Determine whether the graph is empty is_graph_empty(graph) #> [1] TRUE # Create a graph with nodes and edges nodes <- create_nodes(nodes = c("a", "b", "c", "d")) edges <- create_edges(from = c("a", "b", "c"), to = c("d", "c", "a")) graph <- create_graph(nodes_df = nodes, edges_df = edges) # Determine whether the graph is empty is_graph_empty(graph) #> [1] FALSE ## End(Not run)