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

count_unconnected_nodes

Get count of all unconnected nodes


Description

From a graph object of class dgr_graph, get a count of nodes in the graph that are not connected to any other node.

Usage

count_unconnected_nodes(graph)

Arguments

graph

A graph object of class dgr_graph.

Value

A numeric vector of single length.

Examples

# Create a graph with a
# path of nodes and 3
# unconnected nodes
graph <-
  create_graph() %>%
  add_path(n = 3) %>%
  add_n_nodes(n = 3)

# Get a count of all nodes
# in the graph
graph %>% count_nodes()

# Get a count of all
# unconnected nodes in the
# graph
graph %>%
  count_unconnected_nodes()

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.