Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ggdag_classic

Quickly plot a DAG in ggplot2


Description

ggdag_classic() is a wrapper to quickly plot DAGs in a more traditional style.

Usage

ggdag_classic(
  .tdy_dag,
  ...,
  size = 8,
  label_rect_size = NULL,
  text_label = "name",
  text_col = "black"
)

Arguments

.tdy_dag

input graph, an object of class tidy_dagitty or dagitty

...

additional arguments passed to tidy_dagitty()

size

text size, with a default of 8.

label_rect_size

specify the fontsize argument in ggraph::label_rect; default is NULL, in which case it is scaled relative ti size

text_label

text variable, with a default of "name"

text_col

text color, with a default of "black"

Value

a ggplot

See Also

Examples

dag  <- dagify(y ~ x + z2 + w2 + w1,
  x ~ z1 + w1,
  z1 ~ w1 + v,
  z2 ~ w2 + v,
  w1 ~~ w2)

ggdag_classic(dag)
ggdag_classic(dag) + theme_dag_blank()

ggdag_classic(dagitty::randomDAG(5, .5))

ggdag

Analyze and Create Elegant Directed Acyclic Graphs

v0.2.3
MIT + file LICENSE
Authors
Malcolm Barrett [aut, cre] (<https://orcid.org/0000-0003-0299-5825>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.