Skip to contents

Create a diagram to show participant progress through a study workflow via the counts of study participants who reach each point in the study workflow. Create the diagram diagram from a detailed dataframe, describing the progress of each research participant, the parent child relationships that define the study progression, and pretty labels for each state and step in the protocol.

Usage

create_mermaid_diagram(
  participant_level_progress,
  parents,
  children,
  pretty_labels,
  render = TRUE
)

Arguments

participant_level_progress

A detail dataframe describing the progress of each research participant

parents

A vector nodes of the diagram that have children

children

A vector enumerating the child categorical level below the corresponding parent

pretty_labels

A dataframe defining the pretty labels for each step and each factor level

render

A logical to indicate if the mermaid syntax should be rendered into a diagram or if the syntax should be returned (default = TRUE)

Value

A plot of the study progress or the mermaid syntax to generate it

Examples

if (FALSE) { # \dontrun{
create_mermaid_diagram(
  participant_level_progress = participant_level_progress,
  parents = steps$parent,
  children = steps$child,
  pretty_labels = pretty_labels
)
} # }