如果使用故事板布局,如何在R flexdashboard页面上显示多个图

use*_*999 2 r flexdashboard

我正在以故事板格式构建R FlexDashboard.我想在一些故事板页面上显示多个图表,包括一系列使用串扰的链接图.但是,当我尝试在页面上显示多个绘图或使用bscols()函数时,页面看起来都搞砸了.R FlexDashboard的故事板格式是否允许多个绘图?这是一个例子:

---
title: "Error_example"
output: 
  flexdashboard::flex_dashboard:
    storyboard: true
    theme: bootstrap
---

###Example: Why can't won't the datatable show up below the plot in this storyboard?

```{r}
library(plotly)
library(DT)

plot1<-plot_ly(data=diamonds,x=~carat,y=~price)
table1<-datatable(diamonds)

plot1
table1
Run Code Online (Sandbox Code Playgroud)

MrH*_*pko 6

bsCols() 似乎完全覆盖了flexdashboard CSS,所以我会避免使用它.

一个简单的解决方案是将一些div添加到R块中.就像是:

---
title: "I think this should work"
output: 
  flexdashboard::flex_dashboard:
    storyboard: true
    theme: bootstrap
---

###Example: Using divs to separate outputs

```{r}
library(shiny)
library(plotly)
library(DT)

plot1<-plot_ly(data=diamonds,x=~carat,y=~price)
table1<-datatable(diamonds)

 tags$div(
   tags$div(
    plot1
  ),
  tags$div(
    table1
  )
 )
```
Run Code Online (Sandbox Code Playgroud)