Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is_graph_empty

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

Graph/Network Visualization

v1.0.6.1
MIT + file LICENSE
Authors
Richard Iannone [aut, cre] (<https://orcid.org/0000-0003-3925-190X>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.