Description Usage Arguments Details Value Note Examples
Creates a graph of the parent/child relationships among a set of proto objects.
1 | 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
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.