graph.proto {proto} | R Documentation |
Creates a graph of the parent/child relationships among a set of proto objects.
graph.proto(e, g = new("graphNEL", edgemode = "directed"), child.to.parent = TRUE)
e |
A proto object or an environment whose proto objects will be graphed. |
g |
A graph to add the edges and nodes to. Defaults to an empty graph. |
child.to.parent |
If TRUE then arrows are drawn from child to parent; otherwise, from parent to child. |
This function is used to create a graph in the sense of the
"graph"
package out of the parent child relationships
of proto objects. All "proto"
objects in "e"
and their immediate parents are placed in the graph.
The objects are labelled using their "..Name"
component.
If there is no "..Name"
component then their
variable name in "e"
is used. In the case
of a parent that is not in "e"
, an internally generated
name will be used if the parent has no "..Name"
component.
If two "proto"
objects to be graphed have the same name
the result is undefined.
Produces an object of class "graph"
that can subsequently
be plotted.
graph.proto
makes use of the Rgraphviz
package in the BioConductor
repository and so
Rgraphviz
must be installed and loaded. On Linux one gotcha
is that you may need to add the
graphviz
shared library, e.g. to add the directory containing
the .so
files,
to your linker path via:
export LD_LIBRARY_PATH=/path/to/graphviz/libs
.
## Not run: a <- proto() b <- a$proto() g <- graph.proto() plot(g) g <- graph.proto(child.to.parent = FALSE) # change arrow heads plot(g) g <- graph.proto(g = new("graphNEL")) # undirected plot(g) g <- graph.proto() attrs <- list(node = list(fillcolor = "lightgreen"), edge = list(color = "cyan"), graph = list(rankdir = "BT")) plot(graph.proto(), attrs = attrs) # specify plot attributes ## End(Not run)