Generate a flowchart of the history of the dataframe(s), with all the tracked data pipeline as stages in the flowchart. Multiple dataframes can be plotted together in which case an attempt is made to determine which parts are common.
p_flowchart(
.data,
filename = NULL,
size = std_size$full,
maxWidth = size$width,
maxHeight = size$height,
formats = c("dot", "png", "pdf", "svg"),
defaultToHTML = TRUE,
landscape = size$rot != 0,
...
)the nature of the flowchart output depends on the context in which
the function is called. It will be some form of browse-able html output if
called from an interactive session or a PNG/PDF link if in knitr and
knitting latex or word type outputs, if file name is specified the output
will also be saved at the given location.
the tracked dataframe(s) either as a single dataframe or as a list of dataframes.
a file name which will be where the formatted flowcharts are
saved. If no extension is specified the output formats are determined by
the formats parameter.
a named list with 3 elements, length and width in inches and rotation. A predefined set of standard sizes are available in the std_size object.
a width (on the paper) in inches if size is not defined
a height (on the paper) in inches if size is not defined
some of pdf,dot,svg,png,ps
if the correct output format is not easy to determine
from the context, default providing HTML (TRUE) or to embedding the PNG (FALSE)
rotate the output by 270 degrees into a landscape format.
maxWidth and maxHeight still apply and refer to the paper width to fit
the flowchart into after rotation. (you might need to flip width and height)
ignored
Named arguments passed on to p_get_as_dot
fillthe default node fill colour, any R colour or hex value
fontsizethe default font size in points
colourthe default font colour, any R colour or hex value
rankdirthe dot rank direction (one of TB,LR,BT,RL)
roundedshould the node corners be rounded?
fontnamethe font to use. Must exist on the system.
bgcolourthe background, may be "transparent", any R colour or hex value
library(dplyr)
library(dtrackr)
tmp = iris %>% track() %>% comment(.tag = "step1") %>% filter(Species!="versicolor")
tmp %>% dplyr::group_by(Species) %>% comment(.tag="step2") %>% flowchart()
Run the code above in your browser using DataLab