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)

hgvandenboorn/hgutils documentation built on Sept. 9, 2019, 2:50 a.m.