I want to add a flowchart (graph) to an Rmarkdown document I am creating. The flowchart needs to include numbers that are calculated by some R code.
I have installed both the DiagrammeR
and nomnoml
packages as they look like either of them might be able to do what I'm after. However, an attempt to knit the .Rmd document returns an error:
Error: Functions that produce HTML output found in document targeting docx output.
Please change the output type of this document to HTML. Alternatively, you can allow
HTML output in non-HTML formats by adding this option to the YAML front-matter of
your rmarkdown file:
always_allow_html: true
Note however that the HTML output will not be visible in non-HTML formats.
Execution halted
A sample .Rmd document:
---
title: "Untitled"
author: "Unauthored"
date: "n.d."
output: word_document
---
A DiagrammeR graph:
```{r}
DiagrammeR::grViz("digraph rmarkdown {A -> B}")
```
A nomnoml graph:
```{r}
nomnoml::nomnoml("[Hello]-[World!]")
```
Some writing after.