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

count_w_connected_cmpts

Get the number of weakly-connected components


Description

Get the number of weakly-connected components in the graph.

Usage

count_w_connected_cmpts(graph)

Arguments

graph

A graph object of class dgr_graph.

Value

A single integer value representing the number of weakly-connected graph components.

Examples

# Create a cycle graph
graph <-
  create_graph() %>%
  add_cycle(n = 5) %>%
  add_cycle(n = 5)

# Get a count of weakly-connected
# components in the graph
graph %>% count_w_connected_cmpts()

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.