aes_dag: Define Aesthetics for Directed Acyclic Graphs (DAGs)

View source: R/geom_dag.R

aes_dagR Documentation

Define Aesthetics for Directed Acyclic Graphs (DAGs)

Description

aes_dag() is a wrapper around aes() that specifies x, y, xend, and yend, which are required for most DAG visualizations. It merges any additional aesthetics, e.g. color or shape, with the default aesthetic mappings.

Usage

aes_dag(...)

Arguments

...

Additional aesthetic mappings passed as arguments. These can include any aesthetic supported by ggplot2 (e.g., color, size, shape).

Value

A ggplot2 aesthetic mapping object that includes both the default DAG aesthetics and any user-specified aesthetics.

Examples

library(ggplot2)
confounder_triangle() %>%
  dag_adjustment_sets() %>%
  ggplot(aes_dag(color = adjusted)) +
  geom_dag() +
  facet_wrap(~set)


malcolmbarrett/ggdag documentation built on March 8, 2024, 5:49 p.m.