drawPathDiagram: Draw a path diagram

View source: R/utils.R

drawPathDiagramR Documentation

Draw a path diagram

Description

drawPathDiagram renders boxes and labelled arrows as a ggplot. Arrows run between box borders; an edge whose to is not a node name ends at its explicit toX/toY point (used to point at a path).

Usage

drawPathDiagram(nodes, edges, ggtheme, theme, sigCaption = TRUE)

Arguments

nodes

Data frame with name, label, x, y.

edges

Data frame with from, to, toX, toY, fromX, fromY, label, nudgeX, nudgeY (label offset from the arrow midpoint) and hjust (1 grows the label leftwards from its position, 0 rightwards, 0.5 centers it, so the gap to the arrow stays constant however long the label is). Arrows run between box borders by default; non-NA fromX/fromY and toX/toY override the anchor points.

ggtheme

The jamovi ggplot2 theme.

theme

The jamovi theme colors.

sigCaption

Whether to caption the significance star cutoffs.


medmod documentation built on July 16, 2026, 9:07 a.m.