| Title: | Flowcharts with 'ggplot2' | 
| Version: | 1.0.0 | 
| Description: | Flowcharts can be a useful way to visualise complex processes. This package uses the layered grammar of graphics of 'ggplot2' to create simple flowcharts. | 
| License: | MIT + file LICENSE | 
| Encoding: | UTF-8 | 
| Depends: | R (≥ 3.6) | 
| Imports: | dplyr, igraph, ggplot2, rlang, tibble, tidyr | 
| Suggests: | knitr, rcartocolor, rmarkdown | 
| RoxygenNote: | 7.2.3 | 
| VignetteBuilder: | knitr | 
| Config/Needs/website: | nrennie/nrenniepkgdown | 
| URL: | https://nrennie.github.io/ggflowchart/ | 
| NeedsCompilation: | no | 
| Packaged: | 2023-05-11 09:01:25 UTC; nrenn | 
| Author: | Nicola Rennie [aut, cre, cph] | 
| Maintainer: | Nicola Rennie <nrennie35@gmail.com> | 
| Repository: | CRAN | 
| Date/Publication: | 2023-05-11 10:10:05 UTC | 
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)