R Markdown中如何在Distill文章中水平对齐Highcharter对象?

问题描述 投票:0回答:1

在R Markdown中,如何在Distill网站中把多个Highcharter对象挨着对齐?我一直在尝试

---
title: "Untitled"
output: distill::distill_article
---

```{r, message = FALSE, echo = TRUE}
library(highcharter)
library(dplyr)
data(diamonds, economics_long, mpg, package = "ggplot2")
economics_long2 <- economics_long %>% 
  filter(variable %in% c("pop", "uempmed"))
economics_long3 <- economics_long %>%
  filter(variable %in% c("pop", "unemploy"))

hw_grid(
  hchart(economics_long2, "line", hcaes(x = date, y = value01, group = variable)),
  hchart(economics_long3, "line", hcaes(x = date, y = value01, group = variable)),
  ncol = 2
)
```

在标准的HTML输出中,即为 output: html_document 这个代码很好用。但是,对于Distill文章,两个highcharter对象不会挨着打印。

r highcharts r-markdown r-highcharter
1个回答
0
投票

到目前为止,只是添加了 fig.show='hold' 你可能会有一些运气,在Rmarkdown中实现一些HTML的对齐方式,我试过使用 out.width="50%" 作为一个分块的说法,但没有运气

© www.soinside.com 2019 - 2024. All rights reserved.