首页 > 解决方案 > Flexdashboard (RMarkdown) - 侧边栏中是否可以使用标签集?

问题描述

为这个特定项目使用 RMarkdown。

我的 flexdashboard 中有一个侧边栏。如果可能的话,我想在我的仪表板的侧边栏中有一个标签集,但是我在让它工作时遇到了问题。我的选项卡式数据最终出现在仪表板的主要部分,而不是侧边栏中。

title: "Tabs in Sidebar"
Author: "Derek"
output: flexdashboard

Main Page {data-orientation=rows}
=================================

Column {.sidebar}
---------------------------------

## Sidebar Title {.tabset}

### Tab 1
Content for tab 1 goes here

### Tab 2
Content for tab 2 goes here

Row {}
---------------------------------
Main page content is here

我也尝试过类似的方法,为每个标题添加一个额外的哈希,但无济于事:

title: "Tabs in Sidebar"
Author: "Derek"
output: flexdashboard

Main Page {data-orientation=rows}
=================================

Column {.sidebar}
---------------------------------

### Sidebar Title {.tabset}

#### Tab 1
Content for tab 1 goes here

#### Tab 2
Content for tab 2 goes here

Row {}
---------------------------------
Main page content is here

希望有 RMarkdown 经验的人能告诉我这样的事情是否可行。

标签: rr-markdownflexdashboard

解决方案


对你来说可能有点晚了,但我今天遇到了这个问题并找到了答案。

---
title: "Tabs in Sidebar"
Author: "Derek"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
---

```{r setup, include=FALSE}
library(flexdashboard)
```

Input {.sidebar}
-------------------------------------

Text for sidebar.

Row 
-------------------------------------

### Chart 1

```{r}

```


Row {.tabset .tabset-fade}
-------------------------------------

### Chart 2

```{r}

```

### Chart 3

```{r}

```

在此处输入图像描述


推荐阅读