Skip to contents

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

Usage

read_caugi(path, lazy)

Arguments

path

Character string specifying the file path.

lazy

DEPRECATED, no longer necessary. The graph is always built lazily, so this argument is ignored.

Value

A caugi object.

Details

The function validates the file format and version, ensuring compatibility with the current version of the caugi package.

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)