gpt4 book ai didi

r - 如果使用 Storyboard布局,如何在 R flexdashboard 页面上显示多个图

转载 作者:行者123 更新时间:2023-12-01 23:15:14 27 4
gpt4 key购买 nike

我正在以 Storyboard格式构建 R FlexDashboard。我想在几个 Storyboard页面上显示多个情节,包括一系列使用串扰的链接情节。但是,当我尝试在页面上显示多个绘图或使用 bscols() 函数时,页面看起来一团糟。 R FlexDashboard 的 Storyboard格式是否允许多个绘图?下面是一个例子:

---
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

最佳答案

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

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

---
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
)
)
```

关于r - 如果使用 Storyboard布局,如何在 R flexdashboard 页面上显示多个图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43306672/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com