arcs2names: Convert an edge matrix to array of edge names

Description Usage Details See Also

Description

Takes a matrix or data frame of edges, with from nodes in the first column, to nodes in the second. Returns an array of edge names in the form of 'A->B' or 'A–B' for directed and undirected edges respectfully.

Usage

1
arcs2names(edges, directed_edges = TRUE, return_unique = FALSE)

Details

This is useful when you need a way of referencing edges, and you can easily infer the name by which nodes are in the edge. For example, when combine two data frames with different annotations on the same set of edges, you can create a new 'edge_name' variable in both data frames, and merge the two objects, using that variable in 'by' argument for the 'merge' function.

See Also

name_edge_df, name_edges


robertness/bninfo documentation built on May 27, 2019, 10:32 a.m.