View source: R/flowchart-utils.R
inclusion_flowchart | R Documentation |
Creates a patient flowchart which visualizes exclusions and updates the dataset.
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" )
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 |
A flowchart (when creating the flowchart), or updated dataset (when excluding patients).
When excluding patients, the flowchart is updated 'behind the scenes' and is not returned.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.