count_nodes: Get a count of all nodes

View source: R/count_nodes.R

count_nodesR Documentation

Get a count of all nodes

Description

From a graph object of class dgr_graph, get a count of nodes in the graph.

Usage

count_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()


DiagrammeR documentation built on June 22, 2024, 11:21 a.m.