is_graph_empty: Is the graph empty?

View source: R/is_graph_empty.R

is_graph_emptyR Documentation

Is the graph empty?

Description

Provides a logical value on whether the graph is empty (i.e., contains no nodes).

Usage

is_graph_empty(graph)

Arguments

graph

A graph object of class dgr_graph.

Value

A logical value.

Examples

# Create an empty graph
graph <- create_graph()

# Determine whether the graph is empty
graph %>% is_graph_empty()

# Create a non-empty graph
graph <-
  create_graph() %>%
  add_n_nodes(n = 3)

# Determine whether this graph is empty
graph %>% is_graph_empty()


DiagrammeR documentation built on June 22, 2024, 11:21 a.m.