tidy_dagitty | R Documentation |
dagitty
objectTidy a dagitty
object
tidy_dagitty(.dagitty, seed = NULL, layout = "nicely", ...)
.dagitty |
a |
seed |
a numeric seed for reproducible layout generation |
layout |
a layout available in |
... |
optional arguments passed to |
a tidy_dagitty
object
library(dagitty)
library(ggplot2)
dag <- dagitty("dag {
Y <- X <- Z1 <- V -> Z2 -> Y
Z1 <- W1 <-> W2 -> Z2
X <- W1 -> Y
X <- W2 -> Y
X [exposure]
Y [outcome]
}")
tidy_dagitty(dag)
tidy_dagitty(dag, layout = "fr") %>%
ggplot(aes(x = x, y = y, xend = xend, yend = yend)) +
geom_dag_node() +
geom_dag_text() +
geom_dag_edges() +
theme_dag()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.