Description Usage Arguments Value Author(s) Examples

Graph Description Language (DOT) is a simplified and intuitive plain text graphical language. The `dot()`

function renders the DOT markup language in R and also provides the possibility to export the graphs in PostScript and SVG (Scalable Vector Graphics) formats. In addition, it supports literate programming packages such as Knitr and R2HTML. Visit http://haghish.com/dot for downloading examples of creating algorithms and several graphs for `Rmarkdown`

and `R HTML`

to generate dynamic procedural graphs in dynamic documents using the `DOT`

package.

1 |

`DOT` |
This argument takes a string containing the DOT script. It is advised to use single quotation mark for the DOT string since the script often includes double quotations which can crash the function. |

`file` |
defines the file name for exporting the graph. The acceptable file extensions are |

`return` |
specifies if PS or SVG script should be printed in R console. The acceptable values are |

By default, the function only renders and loads the DOT plot in RStudio but does not return any PS or SVG script. If the `return`

argument is specified, it returns PostScript or SVG script. Note that for assigning the script returned from `dot()`

to an object, only `"verbatim"`

value can be used to create a string object.

E. F. Haghish

Medical Informatics and Biostatistics (IMBI)

University of Freiburg, Germany

[email protected]

Department of Mathematics and Computer Science

University of Southern Denmark

[email protected]

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ```
#create a simple DOT graph and load it in RStudio
dot("digraph {A -> B;}")
#to produce a dynamic document including a diagram in 'rmarkdown'
## Not run:
```{r echo=FALSE, results='asis'}
library(DOT)
dot("digraph {A -> B;}", return = "cat")
```
## End(Not run)
#create a DOT graph and export a SVG file to the working directory
dot("digraph {A -> B; B -> C; B -> D;}", file = "myfile.svg")
#export the example above in PostScript format
dot("digraph {A -> B; B -> C; B -> D;}", file = "myfile.ps")
#create a DOT graph and save the script in a string object in R
myString <- dot("digraph {A -> B;}", return = "verbatim")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.