Skip to contents

Writes a caugi graph to a file in Mermaid format.

Usage

write_mermaid(x, file, ...)

Arguments

x

A caugi object.

file

Path to output file.

...

Additional arguments passed to to_mermaid(), such as direction.

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_mermaid(cg, "graph.mmd")

# With custom direction
write_mermaid(cg, "graph.mmd", direction = "LR")
} # }