View source: R/format-graphml.R
| read_graphml | R Documentation |
Imports a GraphML file as a caugi graph. Supports GraphML files exported from caugi with full edge type information.
read_graphml(path, class = NULL)
path |
File path to the GraphML file. |
class |
Graph class to assign. If |
This function provides basic GraphML import support. It reads:
Nodes and their IDs
Edges with source and target
Edge types (if present in edge_type attribute)
Graph class (if present in graph data)
For GraphML files not created by caugi, edge types default to "–>" for directed graphs and "—" for undirected graphs.
A caugi object.
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(),
to_dot(),
to_graphml(),
to_mermaid(),
write_caugi(),
write_dot(),
write_graphml(),
write_mermaid()
# Create and export a graph
cg <- caugi(
A %-->% B,
B %-->% C,
class = "DAG"
)
tmp <- tempfile(fileext = ".graphml")
write_graphml(cg, tmp)
# Read it back
cg2 <- read_graphml(tmp)
# Clean up
unlink(tmp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.