Parse a text representation of (directed) edges, return the index of the directed edge within the edge list.
parse.edge(lines, edges)
lines | a vector of strings representing directed edges |
---|---|
edges | an edge list |
the indices of the directed edges within the edge list
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.
## 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