【发布时间】:2015-09-23 23:52:20
【问题描述】:
我准备了非常简单的带有闪亮小部件的 rmarkdown 文档。我想添加目录,但是虽然我使用了toc: yes,但它根本不起作用,为什么?
---
title: "Test document"
author: "XXX"
date: "XXX"
output:
html_document:
toc: yes
runtime: shiny
---
```{r, echo = FALSE}
h2('R package')
br()
h3('Ggplot2')
br()
h4('Mtcars')
library(ggplot2)
data(mtcars)
selectInput('name', 'Choose a cylinder:',
choices = sort(unique(mtcars$cyl)),
selected = sort(unique(mtcars$cyl))[1])
data <- reactive(subset(mtcars,cyl == input$name))
number <- reactive(which(sort(unique(mtcars$cyl)) == input$name))
renderPlot(ggplot(data(),aes(qsec, mpg))+
geom_point(size = 6))
```
【问题讨论】:
标签: r shiny r-markdown