Mutate the caugi class from one graph class to another, if possible.
For example, convert a DAG to a PDAG, or a fully directed caugi of
class UNKNOWN to a DAG. Throws an error if not possible.
Arguments
- cg
A caugi object.
- class
A character string specifying the new class.
Value
A caugi object of the specified class.
Details
This function returns a copy of the object, and the original remains
unchanged.
Examples
cg <- caugi(A %-->% B, class = "UNKNOWN")
cg_dag <- mutate_caugi(cg, "DAG")