plot_transition_diagram: Plot Transition Diagram

View source: R/plot.R

plot_transition_diagramR Documentation

Plot Transition Diagram

Description

Draws a state transition diagram with event counts annotated on edges. Uses a layered layout that adapts to any number of states and automatically routes arrows around intermediate state boxes using Bezier curves when needed.

Usage

plot_transition_diagram(
  structure,
  msdata = NULL,
  col = NULL,
  main = "Transition Diagram",
  xlab = "",
  ylab = "",
  ...
)

Arguments

structure

An mstate_structure object.

msdata

Optional msdata object to annotate with counts.

col

Node colors. Default uses the standard palette.

main

Title.

xlab, ylab

Optional axis labels; defaults are blank because graph coordinates have no statistical scale.

...

Ignored.

Value

No return value, called for its side effect of producing a plot.

Limitations

The layout is descriptive and preserves the validated DAG. It does not represent cycles/recurrent visits, transition intensity, uncertainty, or edge direction over calendar time. Counts are shown only when a compatible msdata object is supplied.

Examples

ms <- clinical_states()
plot_transition_diagram(ms, xlab = "Graph layer")


RFmstate documentation built on Sept. 10, 2026, 1:09 a.m.