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

count_loop_edges

Get count of all loop edges


Description

From a graph object of class dgr_graph, get a count of all loop edges in the graph.

Usage

count_loop_edges(graph)

Arguments

graph

A graph object of class dgr_graph.

Value

A numeric vector of single length.

Examples

# Create an undirected, full graph
# with 3 nodes and all possible
# edges, including loop edges
graph <-
  create_graph(
    directed = FALSE) %>%
  add_full_graph(
    n = 3,
    keep_loops = TRUE)

# Get a count of all loop edges
# in the graph
graph %>% count_loop_edges()

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.