How can I fix column breaks in an Rmarkdown / ioslides presentation

纵然是瞬间 提交于 2019-12-05 00:00:45
adicara

I've been scratching my head around this also.

You can avoid using the divs and use {.columns-2} as a header attribute.

For the images I set a relatively large size by default in the yaml using fig_height and fig_width. Then, using the out.width attribute in the chunk I control the size of the output (350px seems to work well in this layout)

---
title: "Two Column"
author: "Some guy on Stack Overflow"
date: "Friday, April 04, 2014"
output:
  ioslides_presentation:
    fig_height: 7
    fig_width: 7
---

## Two-Column Attempt {.smaller .columns-2}

Base graphics can be quick...

```{r, out.width =  '350px'}
par_opts <- names(par())
    hist(nchar(par_opts),
         breaks = seq(1.5, 9.5, by = 1))
```


But `ggplot2` can be quick too:

```{r, out.width =  '350px'}
require(ggplot2, quietly = T)
qplot(factor(nchar(par_opts)))
```
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!