Skip to contents

Diagram from data

Generate a CONSORT diagram from a participant disposition data set, counts are calculated automatically.

consort_plot()
Self generating consort diagram
gen_text()
Generate label and bullet points
dispos.data
Demo clinical trial disposition data

Diagram step by step

Build a diagram node by node with a pipeline of add_*() functions. Splits can be nested to any depth.

add_box()
Add nodes
add_split()
Add a splitting box
add_side_box()
Add a side node
add_label_box()
Add a vertically aligned label nodes on the left side.

Plot and export

Draw a diagram with grid graphics, or as Graphviz code for HTML and Shiny use.

plot(<consort>) print(<consort>)
Add methods to print function
build_grid()
Build consort diagram
build_grviz()
Build consort diagram as Graphviz DOT code

Appearance

Package-wide defaults for text, boxes, arrows, padding and markup.

Low-level building blocks

Create, move and connect individual boxes.

textbox() grid.textbox()
Create a box with text
move_box()
Move a box grob
connect_box()
Connect grob box with arrow.
get_coords()
Get the coordinates of the textbox object