在 flexdashboard 中包含 rmarkdown 文本(includeMarkdown 不起作用)(R)

Including rmarkdown text in flexdashboard (includeMarkdown does not work) (R)

我想包含外部降价文件;但是,到目前为止,我无法在 RStudio 上处理它。如果我手动copy/paste将about.md的内容变成main.R,就没有问题。我的意思是设置与 flexdashboard 相关的一切都很好。另一方面,我尝试重新安装 rmarkdown 包并通过库("rmarkdown")导入它。这不够公平,因为 flexdashboard 已经有了它的内部。所以除了 flexdashboard 的安装之外,它应该与是否安装了 rmarkdown 无关。有什么建议么 ? 谢谢

我已经准备了最少的代码,其输出如下: 'about.md'

test1
=======================================================================

**testttt**

testttt

**testttt2**

testttt

main.R

---
title: "test"
author: "test"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    social: menu
    vertical_layout: fill
---

```{r setup, include=FALSE}

library(flexdashboard)
```

```{r}
  includeMarkdown('about.md')
```

输出:

Quitting from lines 17-18 (minimal.Rmd) 
Error in includeMarkdown("about.md") : 
  could not find function "includeMarkdown"
Calls: <Anonymous> ... handle -> withCallingHandlers -> withVisible -> eval -> eval
Execution halted

函数 includemarkdown 来自包 htmltools。所以你必须加载库或使用:

```{r}
htmltools::includeMarkdown('about.md')
```