Learn R Programming

caugi (version 1.0.0)

caugi_serialize: Serialize caugi Graph to JSON String

Description

Converts a caugi graph to a JSON string in the native caugi format. This is a lower-level function; consider using write_caugi() for writing to files.

Usage

caugi_serialize(x, comment = NULL, tags = NULL)

Value

A character string containing the JSON representation.

Arguments

x

A caugi object or an object coercible to caugi.

comment

Optional character string with a comment about the graph.

tags

Optional character vector of tags for categorizing the graph.

See Also

Other export: caugi_deserialize(), caugi_dot(), caugi_export(), caugi_graphml(), caugi_mermaid(), export-classes, format-caugi, format-dot, format-graphml, format-mermaid, knit_print.caugi_export, read_caugi(), read_graphml(), to_dot(), to_graphml(), to_mermaid(), write_caugi(), write_dot(), write_graphml(), write_mermaid()

Examples

Run this code
cg <- caugi(A %-->% B, class = "DAG")
json <- caugi_serialize(cg)
cat(json)

Run the code above in your browser using DataLab