Parse a text representation of (directed) edges, return the index of the directed edge within the edge list.

parse.edge(lines, edges)

Arguments

lines

a vector of strings representing directed edges

edges

an edge list

Value

the indices of the directed edges within the edge list

Details

Each directed edge is represented as a string consisting of two node labels separated by an arrow, where the arrow consists of a sequence of dashes "-" followed by one of the character sequences ">","*","<>". The number of dashes used in the arrow is ignored.

Examples

## Sample model edges <- parse.digraph(c( "E *-> D", "D *-> C", "C -> E", "E *-> B", "B *-> A", "A -> E", "D --> B")) edges <- enforce.limitation(edges) parse.edge(c("E->D","D-*E","A-*B"),edges)
#> [1] 1 8 11