DiagrammeR (version 1.0.0)

is_graph_directed: Is the graph a directed graph?

Description

Determines whether a graph is set to be directed or not and returns a logical value to that effect.

Usage

is_graph_directed(graph)

Arguments

graph

a graph object of class dgr_graph.

Value

a logical value.

Examples

Run this code
# NOT RUN {
# Create an empty graph; by default,
# new graphs made by `create_graph()`
# are directed
graph <-
  create_graph()

# Determine whether the graph
# is directed
graph %>%
  is_graph_directed()

# Use the `set_graph_undirected()`
# function and check again whether
# the graph is directed
graph %>%
  set_graph_undirected() %>%
  is_graph_directed()
# }

Run the code above in your browser using DataCamp Workspace