【问题标题】:flexdashboard page layout errorflexdashboard 页面布局错误
【发布时间】:2018-05-02 04:44:31
【问题描述】:

将 R 版本从 3.3.3 更新到 3.4.2 后,我的 flexdashbords 不再工作

运行这个简单的例子时:

---
title: "Flexdash Layout Test"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
---

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

Page 1
===================================================

Column 1 {data-width=650}
-----------------------------------------------------------------------

### Chart A

```{r}
print('Chart A')
```

Column 2 {data-width=350}
-----------------------------------------------------------------------

### Chart B

```{r}
print('Chart B')
```

Page 2
===============================================

### Chart C

```{r}
print('Chart C')
```

结果如下所示: flexdash layout error

显然格式化语法不起作用。

提前感谢您提供解决该问题的任何提示

编辑: 当我尝试该示例并选择 html 作为输出时,格式化结果看起来像预期的那样。

---
title: "Rmd Formatierung Test"
output: html_document
---

Plain text   

End a line with two spaces  
to start a new paragraph.   
*italics* and _italics_   
**bold** and __bold__   
superscript^2^   
~~strikethrough~~   
[link](www.rstudio.com)  

# Header 1   

## Header 2   

所以这个错误肯定和flexdashboard有关

> sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=German_Austria.1252  LC_CTYPE=German_Austria.1252       LC_MONETARY=German_Austria.1252
[4] LC_NUMERIC=C                    LC_TIME=German_Austria.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] flexdashboard_0.5

loaded via a namespace (and not attached):
[1] compiler_3.4.2  backports_1.1.1 magrittr_1.5    rprojroot_1.2     htmltools_0.3.6 tools_3.4.2    
[7] yaml_2.1.14     Rcpp_0.12.13    stringi_1.1.5   rmarkdown_1.7    knitr_1.17      jsonlite_1.5   
[13] stringr_1.2.0   digest_0.6.12   evaluate_0.10.1

【问题讨论】:

  • 你的例子对我有用,也许你应该重新安装包
  • 我对 Microsoft R Client 3.4.1.0 有同样的问题

标签: r r-markdown flexdashboard


【解决方案1】:

问题记录在这里:https://github.com/rstudio/flexdashboard/pull/150

基本上,pandoc 2.0 默认为 html5 而不是 html,这会破坏 flexdashboard 布局。

你有两个选择:

1) 降级到 pandoc 1.x

2) 安装 Github 包,直到它被推送到 CRAN。这为我解决了这个问题。

remove.packages("flexdashboard")
install.packages("devtools")
library("devtools")
install_github("rstudio/flexdashboard")

【讨论】:

  • 刚刚尝试了您建议的选项 Nr 2) - 从 github 安装了 flexdashboard 包解决了这个问题。谢谢文森特。
猜你喜欢
  • 2016-02-17
  • 1970-01-01
  • 2011-01-22
  • 2016-11-09
  • 2022-08-11
  • 2020-11-05
  • 2018-04-29
  • 2015-01-17
  • 1970-01-01
相关资源
最近更新 更多