Reads a caugi graph from a file in the native caugi JSON format.
Details
The function validates the file format and version, ensuring compatibility with the current version of the caugi package.
See also
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_graphml(),
to_dot(),
to_graphml(),
to_mermaid(),
write_caugi(),
write_dot(),
write_graphml(),
write_mermaid()
Examples
cg <- caugi(
A %-->% B + C,
class = "DAG"
)
# Write and read
tmp <- tempfile(fileext = ".caugi.json")
write_caugi(cg, tmp)
cg2 <- read_caugi(tmp)
# Clean up
unlink(tmp)