Create a diagram to show participant progress through a study workflow
Source:R/create_mermaid_diagram.R
create_mermaid_diagram.Rd
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)