| to_dot | R Documentation |
Converts a caugi graph to the Graphviz DOT format as a string. The DOT format can be used with Graphviz tools for visualization and analysis.
to_dot(x, graph_attrs = list(), node_attrs = list(), edge_attrs = list())
x |
A |
graph_attrs |
Named list of graph attributes (e.g.,
|
node_attrs |
Named list of default node attributes. |
edge_attrs |
Named list of default edge attributes. |
The function handles different edge types:
Directed edges (-->) use -> in DOT
Undirected edges (---) use -- in DOT (or -> with dir=none in digraphs)
Bidirected edges (<->) use -> with [dir=both] attribute
Partial edges (o->) use -> with [dir=both, arrowtail=odot] attribute
Partial edges (--o) use -> with [arrowhead=odot] attribute
Partial edges (o-o) use -> with
[dir=both, arrowtail=odot, arrowhead=odot] attribute
A caugi_dot object containing the DOT representation.
Other export:
caugi_deserialize(),
caugi_dot(),
caugi_export(),
caugi_graphml(),
caugi_mermaid(),
caugi_serialize(),
export-classes,
format-caugi,
format-dot,
format-graphml,
format-mermaid,
knit_print.caugi_export(),
read_caugi(),
read_graphml(),
to_graphml(),
to_mermaid(),
write_caugi(),
write_dot(),
write_graphml(),
write_mermaid()
cg <- caugi(
A %-->% B + C,
B %-->% D,
C %-->% D,
class = "DAG"
)
# Get DOT string
dot <- to_dot(cg)
dot@content
# With custom attributes
dot <- to_dot(
cg,
graph_attrs = list(rankdir = "LR"),
node_attrs = list(shape = "box")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.