Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

toDot-methods

A Generic For Converting Objects To Dot


Description

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

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

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)

Rgraphviz

Provides plotting capabilities for R graph objects

v2.34.0
EPL
Authors
Kasper Daniel Hansen [cre, aut], Jeff Gentry [aut], Li Long [aut], Robert Gentleman [aut], Seth Falcon [aut], Florian Hahne [aut], Deepayan Sarkar [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.