toDot-methods

0th

Percentile

A Generic For Converting Objects To Dot

This generic is used to convert objects of varying classes to the Dot language. Currently, only the graph class is supported.

Keywords
methods, graphs
Usage
toDot(graph, filename, ...)
Arguments
graph
The graph to output to Dot
filename
The name of the file to output to.
...
Any arguments to pass on to agopen
details

The method defined for graph objects is a convenience wrapper around agopen and agwrite in that order. It will take an object of class graph (or one of its subclasses), call agopen (any extra arguments besides the graph and the name parameter should be passed in via ...) and then write the resulting information via agwrite in the file specified by filename.

author

Jeff Gentry

seealso

agopen, agwrite, graph-class

Aliases
  • toDot
  • toDot-methods
  • toDot,graph-method
Examples
  set.seed(123)
  V <- letters[1:10]
  M <- 1:4
  g1 <- randomGraph(V, M, .2)

  nAttrs <- list()
  eAttrs <- list()
  nAttrs$label <- c(a="lab1", b="lab2", g="lab3", d="lab4")
  eAttrs$label <- c("a~h"="test", "c~h"="test2")
  nAttrs$color <- c(a="red", b="red", g="green", d="blue")
  eAttrs$color <- c("a~d"="blue", "c~h"="purple")

  toDot(g1, tempfile(), nodeAttrs=nAttrs, edgeAttrs=eAttrs)
Documentation reproduced from package Rgraphviz, version 2.16.0, License: EPL

Community examples

Looks like there are no examples yet.