flowchart | R Documentation |
Flow
is an R6 class used for initializing, constructing and modifying the
information that goes into the flowchart. The plotting is then handled via the
plot()
function.
## S3 method for class 'Flow'
plot(x, xm = 0.1, ym = 0.1, hpad = 10, vpad = 10, ...)
x |
|
xm , ym |
Outer x/y margins of the plot (.2 = 20% margin on each side); default: 0.1 |
hpad , vpad |
Horzontal/verticl padding around text in chart nodes, in mm; default: 10 |
... |
For S3 method compatibility |
n
Number of nodes
Parent
Vector of parent nodes
x
Vector of horizontal positions
Label
Vector of labels
new()
Initialize a new flowchart at its parent node
Flow$new(lab, x = 0)
lab
Label (node text)
x
Horizontal position (0=center)
print()
Print the current status of the flowchart
Flow$print()
add()
Add a node to the flowchart
Flow$add(lab, parent, x = 0)
lab
Label (node text)
parent
Number (i.e., row) of this node's parent
x
Horizontal position (0=center)
clone()
The objects of this class are cloneable with this method.
Flow$clone(deep = FALSE)
deep
Whether to make a deep clone.
fl <- Flow$new("All children\n(n=935)")
fl$add("Returned form\n(n=511)", parent=1)
fl$add("Baseline: 0\n(n=447)", parent=2, x=-1)
fl$add("Baseline: 1 or 2\n(n=14)", parent=2)
fl$add("Baseline: 3\n(n=50)", parent=2, x=1)
fl$add("Initiation\n(n=315)", parent=3, x=-1)
fl$add("Completion\n(n=276)", parent=6, x=-1)
fl$add("Completion\n(n=12)", parent=4)
fl
plot(fl)
plot(fl, hpad=20, vpad=20)
plot(fl, xm=0.25)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.