【发布时间】:2020-11-01 18:19:47
【问题描述】:
是否可以在 R flexdashboard 中使用操作按钮?
例如在下面的 repex 中,是否可以添加一个按钮,以便代码仅在显示按钮时运行?
我在https://garrettgman.github.io/rmarkdown/flexdashboard/using.html#html_widgets网站上找不到文档
谷歌的大部分信息都涉及在“纯”闪亮的应用程序中使用操作按钮,而不是 flexdashboard。
---
title: "example"
runtime: shiny
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
---
```{r setup, include=FALSE}
library(flexdashboard)
```
Column {data-width=100}
-----------------------------------------------------------------------
### Chart A
```{r}
numericInput("n1", "First number", 10)
```
Column {data-width=900}
-----------------------------------------------------------------------
### Chart B
```{r}
DT::renderDataTable({
x = sample(1:input$n1, size=500, replace=TRUE)
x= as.data.frame(x)
DT::datatable(x, options = list(
bPaginate = FALSE
))
})
```
【问题讨论】:
标签: r shiny flexdashboard