Learn R Programming

dtrackr (version 0.5.0)

p_get_as_dot: DOT output

Description

(advance usage) outputs a dtrackr history graph as a DOT string for rendering with Graphviz

Usage

p_get_as_dot(
  .data,
  fill = .defaultFill(),
  fontsize = .defaultFontSize(),
  colour = .defaultColour(),
  rankdir = .defaultDirection(),
  rounded = .defaultRounded(),
  fontname = .defaultFontName(),
  bgcolour = .defaultBgColour(),
  ...
)

Value

a representation of the history graph in Graphviz dot format.

Arguments

.data

the tracked dataframe

fill

the default node fill colour, any R colour or hex value

fontsize

the default font size in points

colour

the default font colour, any R colour or hex value

rankdir

the dot rank direction (one of TB,LR,BT,RL)

rounded

should the node corners be rounded?

fontname

the font to use. Must exist on the system.

bgcolour

the background, may be "transparent", any R colour or hex value

...

not used

Examples

Run this code
library(dplyr)
library(dtrackr)

tmp = iris %>% track() %>% comment(.tag = "step1") %>% filter(Species!="versicolor")
dot = tmp %>% dplyr::group_by(Species) %>% comment(.tag="step2") %>% p_get_as_dot()
cat(dot)

Run the code above in your browser using DataLab