dagR2dagitty: Create dagitty code from a dagR DAG

View source: R/dagR2dagitty.R

dagR2dagittyR Documentation

Create dagitty code from a dagR DAG

Description

Translates a DAG as defined in a dagRdag object created by dagR into the dagitty package format. Node labeling follows the rules used for plotting dagRdag objects, but adjusted nodes are marked by a preceding underscore instead of under- and over-line.

Usage

dagR2dagitty(x, alt.symb = TRUE, only.code = TRUE)

Arguments

x

The dagR DAG to be translated.

alt.symb

Boolean indicating if the alternative node symbols should be used.

only.code

If TRUE, a string with R dagitty function call is returned, which should be checked by the user (and possibly edited as required) before running it to create an equivalent dagitty DAG. If FALSE and the dagitty package has been installed and loaded, the dagitty function is called directly and the resulting dagitty DAG is returned.

Value

Either a string containing dagitty syntax to translate the dagR DAG into dagitty format, or a dagitty object.

Author(s)

Lutz P Breitling <l.breitling@posteo.de>

References

Breitling LP (2010). dagR: a suite of R functions for directed acyclic graphs. Epidemiology 21(4):586-587.
Breitling LP, Duan C, Dragomir AD, Luta G (2022). Using dagR to identify minimal sufficient adjustment sets and to simulate data based on directed acyclic graphs. Int J Epidemiol 50(6):1772-1777.
https://cran.r-project.org/package=dagitty

See Also

dag.letter2


dagR documentation built on Oct. 9, 2022, 5:06 p.m.