Learn R Programming

caugi (version 1.0.0)

read_caugi: Read caugi Graph from File

Description

Reads a caugi graph from a file in the native caugi JSON format.

Usage

read_caugi(path, lazy = FALSE)

Value

A caugi object.

Arguments

path

Character string specifying the file path.

lazy

Logical; if FALSE (default), the graph is built immediately. If TRUE, graph building is deferred until needed.

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

Run this code
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)

Run the code above in your browser using DataLab