export_graph {cfid}R Documentation

Export Graph

Description

Convert a valid graph object into a supported external format.

Usage

export_graph(
  g,
  type = c("dagitty", "causaleffect", "dosearch"),
  use_bidirected = TRUE,
  ...
)

Arguments

g

An object of class dag.

type

A character string matching one of the following: "dagitty", "causaleffect" or "dosearch". For "dagitty" and "causaleffect", the packages dagitty and igraph must be available, respectively.

use_bidirected

A logical value indicating if bidirected edges should be used in the resulting object. If TRUE, the result will have explicit ⁠X <-> Y⁠ edges. If FALSE, an explicit latent variable X <- U[X,Y] -> Y will be used instead (only applicable if type is "dosearch").

...

Additional arguments passed to format for formatting vertex labels.

Value

If type is "dagitty", returns a dagitty object. If type is "causaleffect", returns an igraph graph, with its edge attributes set according to the causaleffect package syntax. If type is "dosearch", returns a character vector of length one that describes g in the dosearch package syntax.


[Package cfid version 0.1.7 Index]