count_w_connected_cmpts: Get the number of weakly-connected components

Description Usage Arguments Value Examples

View source: R/count_w_connected_cmpts.R

Description

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

Usage

1

Arguments

graph

A graph object of class dgr_graph.

Value

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

Examples

1
2
3
4
5
6
7
8
9
# 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 documentation built on July 2, 2020, 3:19 a.m.