inclusion_flowchart: Patient flowchart

Description Usage Arguments Value Note Examples

View source: R/flowchart-utils.R

Description

Creates a patient flowchart which visualizes exclusions and updates the dataset.

Usage

1
2
3
4
5
6
inclusion_flowchart(dataset, node_text = "%s eligable patients",
  stratum = NULL)

exclude_patients(flowchart, dataset, exclusion_criterium,
  reason = deparse(substitute(exclusion_criterium)),
  node_text = "%s eligable patients", excluded_text = "%s excluded")

Arguments

dataset

The dataset, must be a data.frame.

node_text

The text of the starting node, must be a string which can be interpreted by sprintf.

stratum

An optional stratum, must be variable in dataset.

flowchart

The flowchart object.

exclusion_criterium

A boolean statement which is used to select patients to be discarded from the dataset.

reason

An optional string to specify why patients were excluded. Defaults to the exclusion criterium.

excluded_text

The text of the exclusion node, must be a string which can be interpreted by sprintf.

Value

A flowchart (when creating the flowchart), or updated dataset (when excluding patients).

Note

When excluding patients, the flowchart is updated 'behind the scenes' and is not returned.

Examples

1
2
3
4
5
6
7
8
## Not run: 
dataset = survival::lung; dataset$sex = factor(dataset$sex,labels=c("male","female"))
flowchart = inclusion_flowchart(dataset)
dataset = exclude_patients(flowchart, dataset, status==1) #exclude all patients who did not die
dataset = exclude_patients(flowchart, dataset, time<100) #exclude patients with a short follow-up
flowchart #print diagram

## End(Not run)

Example output

N = 228 eligable patients
 |       
 |-----> N = 63 excluded [status == 1]
 |       
 V
N = 165 eligable patients
 |       
 |-----> N = 31 excluded [time < 100]
 |       
 V
N = 134 eligable patients

hgutils documentation built on Sept. 7, 2019, 5:10 p.m.