dot.proto {proto}R Documentation

Proto graphviz interface

Description

dot.proto creates a GraphViz .dot file showing the relationships among proto objects. oriented system.

Usage

dot.proto(e = if (exists(".that")) .that else parent.frame(), 
     file = "", control)

Arguments

e an environment or proto object to look in for the proto objects. Defaults to current environment.
file file where dot ouput is placed. Defaults to standard output.
control a list of parameters that affects the grahical display. It may be omitted. The include component is a string of dot commands that are included prior to the generated dot output. The default value is "graph [rankdir=BT];". The arrow.from.child component causes arrows to point from children to parents if TRUE, the default, and otherwise from parents to children.

Details

proto creates a GraphViz .dot file which can be transformed to postscript or other displayable graphics format outside of R using the GraphViz dot command to graphically display the relationship among proto objects. Proto objects are identified by the contents of their ..Name component, if any, or else by their name, if available, or else by the hash value of their environment. If there are mulitple variables holding the same proto or environment the results are undefined.

Value

No value is returned.

Note

To create PDF files on Windows from a .dot file created by dot.proto issue the following command at the Windows console dot -Tps2 myfile.dot -o myfile.ps and then use a postscript to PDF translator. For example, with Ghostscript the command ps2pdf myfile.ps myfile.pdf can be used where the ps2pdf command can be found at /gs/.../lib/ps2pdf.bat and ... will depend on the version of ghostscript.

This function may be revised to use GraphViz via the RGraphViz package if and when that package is ported to all common operating systems.

References

http://www.graphviz.org http://www.ghostscript.com

See Also

proto

Examples


oo <- proto(..Name = "root")
oo2 <- oo$proto()
oo3 <- oo$proto()
oo4 <- oo$proto() 
dot.proto()

# different appearance
dot.proto(control = list(include = "") )

# just oo, oo2, oo3.  Display dot commands on console.
dot.proto(proto(oo = oo, oo2 = oo2, oo3 = oo3))   

# same since oo is parent of oo2 and oo3
dot.proto(proto(oo2 = oo2, oo3 = oo3))   

# In R, output dot commands to a file:
#   dot.proto(file = "example.dot")
# Assuming GraphViz is installed, at
# the operating system command line level:
#   dot -Tps example.dot -o example.ps
# or
#   dot -Tjpg example.dot -o example.jpg

[Package proto version 0.3-2 Index]