Skip to contents

Writes a caugi graph to a file in Graphviz DOT format.

Usage

write_dot(x, file, ...)

Arguments

x

A caugi object.

file

Path to output file.

...

Additional arguments passed to to_dot(), such as graph_attrs, node_attrs, and edge_attrs.

Value

Invisibly returns the path to the file.

Examples

cg <- caugi(
  A %-->% B + C,
  B %-->% D,
  C %-->% D,
  class = "DAG"
)

if (FALSE) { # \dontrun{
# Write to file
write_dot(cg, "graph.dot")

# With custom attributes
write_dot(
  cg,
  "graph.dot",
  graph_attrs = list(rankdir = "LR")
)
} # }