YAML 无法在 Rstudio knitr 中成功解析

YAML could not be successfully parsed in Rstudio knitr

我在 RStudio 中遇到 knitr 的问题。突然间它停止了 运行,甚至 knitr 设置也不起作用,向我显示此消息:

The YAML front matter in this document could not be successfully parsed. This parse error needs to be resolved before format options can be edited.

我 运行 的代码很简单:

---
output:
  word_document:default
---
```{r}
Weight <- c(60,72, 57, 90, 95, 72)
Height <- c(1.75, 1.80, 1.65, 1.90, 1.74, 1.91)
BMI <- Weight/Height^2
BMI
```

你能请别人帮助我吗?

:default 可能不需要(毕竟它是默认值),但我相信它不会像写的那样编织的原因是在 yaml 前面的问题中需要在 [=11 之间换行=] 和 default


output:
word_document:
    default
---
```{r}
Weight <- c(60,72, 57, 90, 95, 72)
Height <- c(1.75, 1.80, 1.65, 1.90, 1.74, 1.91)
BMI <- Weight/Height^2
BMI
```