two_column_consort: Two column consort

View source: R/two_column_consort.R

two_column_consortR Documentation

Two column consort

Description

Creates a simple consort diagram. Is a wrapper for functions that generate more complex consort diagrams.

Usage

two_column_consort(variable, top_box_text)

Arguments

variable

A character vector where each element is in the following format: "row col description of exclusion", for example "3 2 BMI < 25".

top_box_text

"A character string that provides the text for the top box of the consort diagram, for example "HCV Patient Registry"

Examples

data <- iris %>% 
namify %>% 
mutate(consort_variable = ifelse(
  petal_width < .15,
  "2 2 Petal width < 0.15",
  ifelse(
    petal_length > 6,
    "3 2 Petal length > 6",
    ifelse(
      sepal_width >= 3 & sepal_width < 4,
      "4 2 Sepal Width in [3, 4)",
      "5 1 Study population"
    )
  )
))

two_column_consort(
  variable = data[,"consort_variable"],
  top_box_text = "Iris dataset"
)

thomasgstewart/tgsify documentation built on Oct. 26, 2024, 8:15 p.m.