R markdown - flexdashboard - 网格布局 & 滚动 & 标签集

标签 r r-markdown flexdashboard

我试图弄清楚如何结合网格布局、行标签集和在 Markdown/flexdashboard 中滚动的能力。

enter image description here

我想要实现的是 Tab 3 应该在 Tab 1 & 2 的右侧,并且能够向下滚动到 Tab 4-6(其中 Tab 6 应该在 4/5 的右侧)。
像这样的东西:

enter image description here

这可能吗?

---
title: "Test"
output: 
  flexdashboard::flex_dashboard:
    orientation: row
    vertical_layout: scroll

---

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


A {data-orientation=rows}
===================================================

Row {data-width=500 data-height=400 .tabset}
-----------------------------------------------------------------------

### Tab 1 {data-height=400 data-width=500}

```{r}
plot(rnorm(10))
```

### Tab 2 {data-height=400 data-width=500}

```{r}
plot(rnorm(10))
```

Column 
-----------------------------------------------------------------------

### Tab 3 {data-height=400 data-width=300}
Some text


Row {data-width=500 data-height=400 .tabset}
-----------------------------------------------------------------------

### Tab 4 {data-height=400 data-width=500}

```{r}
plot(rnorm(10))
```

### Tab 5 {data-height=400 data-width=500}

```{r}
plot(rnorm(10))
```


Column 
-----------------------------------------------------------------------

### Tab 6 {data-height=400 data-width=300}

Some text

最佳答案

这是您问题的可能解决方案

enter image description here

这是代码

---
title: "Test"
output: flexdashboard::flex_dashboard
---

```{r setup, include=FALSE}
library(flexdashboard)
require(shinydashboard)
require(shiny)
require(plotly)
```


A {data-orientation=rows}
===================================================

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

```{r}
p1 <- plot_ly(x = 1:10, y = rnorm(10))
tabBox(width=5,tabPanel("Tab1", p1), tabPanel("Tab2"), height = "450px")
```

```{r}
tabBox(width=7, tabPanel("Tab3","Some text"), height = "450px")
```

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

```{r}
p2 <- plot_ly(x = 1:10, y = rnorm(10))
tabBox(width=5, tabPanel("Tab4",p2), tabPanel("Tab5"), height = "450px")
```

```{r}
tabBox(width=7, id = "tabset4", tabPanel("Tab6","Some text"), height = "450px")
```

关于R markdown - flexdashboard - 网格布局 & 滚动 & 标签集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48702343/

相关文章:

r - 从大 `sapply` 中的错误中解脱出来

r - 如何在 RMarkdown Word 输出中将标题页与目录分开?

rstudio - 使用 Rstudio 实时预览 Rmarkdown 文档

r - 如何使用 RMarkdown 在 ioslides 演示文稿中插入脚注

r - 如何在shiny或flexdashboard中制作用户选择的变量的图表?

r - 具有 Shiny 运行时的多页 Flexdashboard - 如何在 Shiny 的模块观察器中检测页面更改

r - 如何解释H2O的混淆矩阵?

r - 如何在 ggplot2 R 中使较小的气泡高于较大的气泡?

r - 如何以程序方式将绘图嵌入到 RMarkdown 的选项卡中?

r - 过滤串扰的两个键