two_column_consort: Two column consort

Description Usage Arguments Examples

View source: R/two_column_consort.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
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 June 18, 2020, 11:10 a.m.