我有两个flexdashboard
量规,我想在 Rmarkdown -> html 文件中并排绘制。该文件并不意味着是一个 flexdashboard,只是试图使用该包中的漂亮仪表。
---
title: "Eye Gaugeing"
author: "Databot"
date: "10/24/2016"
output: html_document
fig_caption: yes
---
```{r setup, include=FALSE}
library(flexdashboard)
gauge1_data <- 95
gauge2_data <- 63
max_data <- 100
```
## Gauges
```{r gauge, fig.width=2, fig.height=2, fig.cap='Cap1'}
gauge(round(100*(1.0*gauge1_data)/max_data,2),0,100, symbol = '%', label= "Non-Stops: Tile 1", gaugeSectors(
success = c(80, 100), warning = c(40, 79), danger = c(0, 39)))
```
```{r gauge2, fig.width=2, fig.height=2, fig.cap='Cap1'}
p0 <- gauge(round(100*(1.0*gauge2_data)/max_data,2),0,100, symbol = '%', label= "Full Cabin Match: Tile 1", gaugeSectors(
success = c(80, 100), warning = c(40, 79), danger = c(0, 39)))
```
令人惊讶的是,我很难让他们并排。尝试使用library(gridExtra)
但它只喜欢安排所谓的东西grobs
。仪表是类htmlwidget
& gauge
。
还尝试{r out.width=c('500px', '300px'), fig.show='hold'}
将它们都塞进同一个块中,但出现错误。
我会很感激任何建议。