read.digraph | R Documentation |
Read and write text representations of models
read.digraph(file, labels = NULL) parse.digraph(lines, labels = NULL) deparse.digraph(edges) write.digraph(edges, file = "")
file |
the name of the file to read or write |
labels |
the sequence of labels to use for the nodes |
lines |
a string representation of the model |
edges |
an edge list. |
The functions read.digraph
and parse.digraph
read a model
description from a text file and a string respectively, while
write.digraph
writes a text representation of the model to and file.
These functions recognize the following text format. Each line corresponds to an edge, and must consist of two node labels separated by an arrow. An arrow consists of one of the character sequences "<","*","<>" or "" on the left and ">","*","<>" or "" on the right, separated by a sequence of dashes "-". The number of dashes used in the arrow defines the group number of the edge.
The write.digraph
function invisibly returns the
text that was written to the file.
The functions read.digraph
and parse.digraph
return an
edge list - a data frame with columns
|
a factor indicating the origin of each edge (the node that effects) |
|
a factor indicating the destination of each edge (the node that is effected) |
|
an integer vector that indicates the group each edge belongs to |
|
a factor indicating the edge type - "N" (negative) ,"P" (positive),"U" (unknown) or "Z" (zero) |
|
an integer vector that indicates the pairing of directed edges |
Each edge of the text specification is separated into two directed edges, and every row of an edge list corresponds to a single directed edge.
edges <- parse.digraph(c("A <-* B","C *-> A","C <- D", "D -> B","B *--* C","A <--- D")) edges deparse.digraph(edges)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.