简体   繁体   English

如何在 Rmarkdown 文件中包含 DiagrammeR/美人鱼流程图

[英]How to include DiagrammeR/mermaid flowchart in a Rmarkdown file

I have an R markdown file:我有一个 R markdown 文件:

---
title: "Untitled"
author: "Me"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. 

As well as a DiagrammeR/mermaid chart:以及 DiagrammeR/美人鱼图表:

graph LR
    A-->B

How can I add the chart in the R-markdown?我怎样才能在R-markdown中添加图表?

Actually it is trivial:其实很简单:

---
title: "Untitled"
author: "Me"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. 

```{r}
library(DiagrammeR)
mermaid("
graph LR
    A-->B
")
```

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM