if (FALSE) {
model <- make_model('X -> K -> Y')
# Simple plot
model |> plot_model()
# Adding additional layers
model |> plot_model() +
ggplot2::coord_flip()
# Adding labels
model |>
plot_model(
labels = c("A long name for a \n node", "This", "That"),
nodecol = "white",
textcol = "black")
# Controlling positions and using math labels
model |> plot_model(
x_coord = 0:2,
y_coord = 0:2,
title = "Mixed text and math: $\\alpha^2 + \\Gamma$")
}
# DAG with unobserved confounding and shapes
make_model('Z -> X -> Y; X <-> Y') |>
plot(x_coord = 1:3, y_coord = 1:3, shape = c(15, 16, 16))
Run the code above in your browser using DataLab