【问题标题】:Run shiny document with table of content使用目录运行闪亮的文档
【发布时间】:2021-12-02 10:33:31
【问题描述】:

当我添加以下行以将目录添加到闪亮文档时:

toc: true
toc_float: true

文档无法运行。没有它们它运行良好。我收到以下错误:

Error Scanner error: mapping values are not allowed in this context at line 5, column 8(第 5 行是toc: true

我该如何解决这个问题?

我运行的代码:

---
title: "Untitled"
runtime: shiny
output: 
  html_document
    toc: true
    toc_float: true
---

### section 1
```{r, echo=FALSE}
sliderInput("slider", "Number of observations:", 1, 100, 50)

renderText({paste0(rep('blah', 100), collapse = '\n')})
```

### section 2
```{r, echo=FALSE}
renderPlot({hist(rnorm(500)[seq_len(input$slider)])})
```

【问题讨论】:

    标签: r shiny r-markdown


    【解决方案1】:

    您只是缺少来自html_document 的:。应该是html_document:

    ---
    title: "Untitled"
    runtime: shiny
    output: 
      html_document:
        toc: true
        toc_float: true
    ---
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-07-08
      • 2020-12-02
      • 1970-01-01
      • 2016-02-22
      • 2014-08-09
      • 1970-01-01
      • 2016-02-09
      相关资源
      最近更新 更多