r - 作为交互式仪表板滑入 R
问题描述
在 R 演示文稿中是否不可能有一张幻灯片,比如 ioslides,这是一个交互式仪表板?在 Rstudio 中,flexdashboard 必须作为不同的文件打开,并且 Shiny 仪表板不会在幻灯片演示中运行。谢谢
解决方案
您可以runtime: shiny
在文档的标题中使用。
---
output: ioslides_presentation
runtime: shiny
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
## Slide {.smaller}
### Here are two Shiny widgets
```{r echo = FALSE}
selectInput("n_breaks", label = "Number of bins:",
choices = c(10, 20, 35, 50), selected = 20)
```
### ...that build a histogram.
```{r echo = FALSE}
renderPlot({
hist(faithful$eruptions, probability = TRUE,
breaks = as.numeric(input$n_breaks),
xlab = "Duration (minutes)",
main = "Geyser eruption duration")
})
```
结果是一张带有交互式的幻灯片selectInput
,允许更改直方图的中断:
您可以在此处找到更多详细信息:https ://shiny.rstudio.com/articles/interactive-docs.html
推荐阅读
- java - 升级到 Spring Boot 2.2.2 后无法加载应用程序上下文
- jhipster - Jhipster 在实体更新后更新假数据 csv 文件
- angular - Angular 7 - 材料 - 表列过滤器和列排序 - 边缘
- python - Kubernetes 中使用 Ingress 的 Django 文档
- php - php://input 流在基于 lighttpd 和 yocto 的图像上为空
- maven - Jib - 如何使用基础镜像中的环境变量
- python - Pandas / Python - 数据框和字典之间的多个条件匹配
- android - Flutter Charts:在每个点上方显示值
- php - 如何映射产品实体以使其由 Doctrine 管理?
- html - HTML 动画介绍不会开始