Get detailed information on edges

Share:

Description

Obtain a data frame with detailed information on edges and their interrelationships within a graph.

Usage

1
edge_info(graph)

Arguments

graph

a graph object of class dgr_graph.

Value

a data frame containing information specific to each edge within the graph.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Create a node data frame (ndf)
nodes <-
  create_nodes(
    nodes = LETTERS,
    label = TRUE,
    type = c(rep("a_to_g", 7),
             rep("h_to_p", 9),
             rep("q_to_x", 8),
             rep("y_and_z",2)))

# Create an edge data frame (edf)
edges <-
  create_edges(
    from = sample(LETTERS, replace = TRUE),
    to = sample(LETTERS, replace = TRUE),
    rel = "letter_to_letter")

# Create a graph using the ndf and edf
graph <-
  create_graph(
    nodes_df = nodes,
    edges_df = edges)

# Get a data frame with information on the edges
# of the graph
edge_info(graph)
#>    from   to              rel
#> 1     A    Z letter_to_letter
#> 2     H    U letter_to_letter
#> 3     W    O letter_to_letter
#> 4     U    K letter_to_letter
#> 5     I    V letter_to_letter
#>..   ...  ...              ...

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.