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

is_edge_mutual

Is the edge mutual with another edge?


Description

Determines whether an edge definition has a mutual analogue with the same node pair.

Usage

is_edge_mutual(graph, edge)

Arguments

graph

A graph object of class dgr_graph.

edge

A numeric edge ID value.

Value

A logical value.

Examples

# Create a graph that has mutual
# edges across some node pairs
graph <-
  create_graph() %>%
  add_path(n = 4) %>%
  add_edge(
    from = 4,
    to = 3) %>%
  add_edge(
    from = 2,
    to = 1)

# Get the graph's internal
# edge data frame
graph %>% get_edge_df()

# Determine if edge `1` has
# a mutual edge
graph %>%
  is_edge_mutual(edge = 1)

# Determine if edge `2` has
# a mutual edge
graph %>%
  is_edge_mutual(edge = 2)

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.