If confounds are indicated (provided in attr(model$P, 'confounds')
),
then these are represented as bidirectional arcs. Builds on functionality
from ggdag and dagitty.
Usage
plot_model(
model = NULL,
x_coord = NULL,
y_coord = NULL,
title = "",
textcol = "white",
textsize = 3.88,
shape = 16,
nodecol = "black",
nodesize = 16
)
Arguments
- model
A
causal_model
object generated frommake_model
- x_coord
A vector of x coordinates for DAG nodes. If left empty, coordinates are randomly generated
- y_coord
A vector of y coordinates for DAG nodes. If left empty, coordinates are randomly generated
- title
String specifying title of graph
- textcol
String specifying color of text labels
- textsize
Numeric, size of text labels
- shape
Indicates shape of node. Defaults to circular node.
- nodecol
String indicating color of node that is accepted by ggplot's default palette
- nodesize
Size of node.
Examples
if (FALSE) {
model <- make_model('X -> K -> Y; X <-> Y')
model |>
CausalQueries:::plot_model()
model |>
CausalQueries:::plot_model(
x_coord = 1:3,
y_coord = 1:3,
title = "Mixed text and math: $\\alpha^2 + \\Gamma$")
}