add.node: Add a node to a flowchart.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/add.node.R

Description

This function adds one or two rows to a flowchart dataframe. Used to describe a dataframe after manipulation.

Usage

1
2
add.node(dataframe, flowchart, label, title, from = NA,
  display.r = TRUE, display.n = TRUE)

Arguments

dataframe

The dataframe to be described. It should at least contain a unique patient identifier called lpnr

flowchart

A flowchart dataframe

label

character, with the node label, used to refer to this node in the from variable

title

character; extended node title, used for display

id

character, name of the patient id. Defaults to lpnr

from

character, refers to the label of the parent node. Set to NA when the node is used as top node; use a character vector to describe merging of two or more parent nodes

display.r

logical; when set to TRUE, the number of records is displayed in the node

display.n

logical; when set to TRUE, the number of patients is displayed in the node

Value

The flowchart dataframe with one or more rows added.

Author(s)

Peter Konings

See Also

create.diagram to create a valid diagram statement from this type of dataframe. create.flowchart creates an empty flowchart dataframe for use by this function.

Examples

1
2
3
4
5
testchart <- create.flowchart()

testdf <- data.frame(lpnr = c(1,1,1,1:10), blah = rep('blah', 13))
testchart <- add.node(testdf, testchart,  'start', 'original dataset')
testchart

lemna/ugir documentation built on May 21, 2019, 3:07 a.m.