如题,似乎不能在 flexdashboard 里同时使用全局和局部 sidebar,一个可复现的例子如下
---
title: "Sidebar for Multiple Pages"
output:
flexdashboard::flex_dashboard:
orientation: rows
runtime: shiny
---
Sidebar {.sidebar}
=====================================
```{r global}
# 全局输入
sliderInput("x_bins",
"水平方向的窗宽:",
min = 0,
max = 1,
value = 0.7
)
sliderInput("y_bins",
"垂直方向的窗宽:",
min = 1,
max = 10,
value = 7
)
```
Page 1
=====================================
### Chart 1
```{r}
```
Page 2
=====================================
Inputs {.sidebar}
-------------------------------------
```{r}
# 局部输入
numericInput("n_cnt",
"展示数据的行数",
value = 6,
min = 1,
max = 20
)
```
折叠 {.tabset .tabset-fade}
-------------------------------------
### Chart 2
```{r}
```
### Chart 3
```{r}
```
当同时使用的时候,会出现 sidebar 覆盖的情况
参考:https://rmarkdown.rstudio.com/flexdashboard/layouts.html#input_sidebar