ggflowchart {ggflowchart} | R Documentation |
Generate a flowchart in ggplot2
Description
Generates the flowchart
Usage
ggflowchart(
data,
node_data = NULL,
fill = "white",
colour = "black",
text_colour = "black",
text_size = 3.88,
arrow_colour = "black",
arrow_size = 0.3,
family = "sans",
x_nudge = 0.35,
y_nudge = 0.25,
horizontal = FALSE,
color = NULL,
text_color = NULL,
arrow_color = NULL
)
Arguments
data |
Data frame or tibble of edges. Must have two columns, first column are "from" node names, second column is "to" node names. Node names must be unique. |
node_data |
Data frame or tibble of node information. Must have at least one column called "name" for node names to join by. Default NULL. |
fill |
Fill colour of nodes. Must be a valid colour name or hex code, or the name of a column in node_data (quoted or unquoted). Column names take priority over names of colours. Default "white". |
colour |
Outline colour of nodes. Must be a valid colour name or hex code. Default "black". |
text_colour |
Colour of labels in nodes. Must be a valid colour name or hex code, or the name of a column in node_data (quoted or unquoted). Column names take priority over names of colours. Default "black". |
text_size |
Font size of labels in nodes. Default 3.88. |
arrow_colour |
Colour of arrows. Must be a valid colour name or hex code. Default "black". |
arrow_size |
Size of arrow head. Default 0.3. |
family |
Font family for node labels. Default "sans" |
x_nudge |
Distance from centre of edge of node box in x direction. Default 0.35. |
y_nudge |
Distance from centre of edge of node box in y direction. Default 0.25. |
horizontal |
Boolean specifying if flowchart should go from left to right. Default FALSE. |
color |
Outline colour of nodes - overrides colour. Must be a valid colour name or hex code. Default NULL. |
text_color |
Colour of labels in nodes - overrides text_colour. Must be a valid colour name or hex code. Default NULL. |
arrow_color |
Colour of arrows - overrides arrow_colour. Must be a valid colour name or hex code. Default NULL. |
Value
A ggplot2 object.
Examples
data <- tibble::tibble(from = c("A", "A", "A", "B", "C", "F"), to = c("B", "C", "D", "E", "F", "G"))
ggflowchart(data)