【问题标题】:Flexdashboard: Multiple pages, multiple orientations (rows v. columns)Flexdashboard:多个页面,多个方向(行与列)
【发布时间】:2021-08-08 03:48:32
【问题描述】:

我对在 Rmarkdown 中使用 Flexdashboard 比较陌生。

我的目标:将第 1 页定位为行,将第二页定位为列。

第 1 页布局为行:

第 2 页布局为列:

我研究过: 这两个帖子没有运气: Flexdashboard multiple attributes page Combine in flexdashboard with multiple pages different types of vertical_layout

在有用的 Rmarkdown 指南中也找不到任何内容:https://bookdown.org/yihui/rmarkdown/layout.html

我试过了 在我的页眉中覆盖全局方向的几个不同版本均无济于事。例如(这不起作用):

Page 2 as columns {data-icon="fa-signal" orientation: columns}
=====

示例代码:

---
title: example
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    vertical_layout: fill
---
---

Page 1 as Rows
=====

Column {data-width=450}
------

### Vis 1

```{r}
plot(iris)
```


column {data-width=450}
------

### Plot 1

```{r}
knitr::kable(mtcars)
```

### Plot2

```{r}
plot(mtcars)
```



Page 2 as columns {data-icon="fa-signal" orientation: columns} #this doesn't work but want dif layout here
=====

Column {data-width=450}
------

### Vis 1

```{r}
plot(iris)
```


column {data-width=450}
------

### Plot 1

```{r}
knitr::kable(mtcars)
```

### Plot2

```{r}
plot(mtcars)
```
   

任何帮助将不胜感激!

【问题讨论】:

    标签: r r-markdown orientation flexdashboard


    【解决方案1】:

    首先,通过删除“orientation: rows”来设置列的方向

    ---
    title: example
    output: 
      flexdashboard::flex_dashboard:
        vertical_layout: fill
    ---
    

    然后对于您想要设置为行的每个后续页面,只需添加 {data-orientation=rows}

    Page 1 as Rows {data-orientation=rows}
    =====
    
    

    【讨论】:

      猜你喜欢
      • 2018-05-22
      • 1970-01-01
      • 1970-01-01
      • 2017-08-30
      • 2020-05-12
      • 1970-01-01
      • 2015-09-03
      • 2021-10-13
      • 1970-01-01
      相关资源
      最近更新 更多