setrsushi.blogg.se

Insert image in rmarkdown
Insert image in rmarkdown





insert image in rmarkdown

On my slide, I want to include 2 plots and 1 table related to life expectancy of certain counties in East Africa. I’m going to use data from the gapminder package, so if you don’t have it installed: install.packages("gapminder")

INSERT IMAGE IN RMARKDOWN HOW TO

In this post, I show how to combine plots and tables using patchwork to create multi-image PowerPoint slides using R Markdown. An alternative to using PowerPoint would be xaringan and doing some fancy layout using CSS, but I’m not very good at CSS and we need the slides in PowerPoint format because other folks at the office add additional slides to the presentations I generate.Īround this time, I was reading tweets about new development on the patchwork package for arranging ggplot objects, and thought that instead of including multiple images on one slide, I could just create a multi-image layout in R and then render that layout to the PowerPoint slide. That is a bummer for me because the original PowerPoint slides I am trying to replicate using R Markdown have multiple images and tables on them. When you have a text paragraph and an image on the same slide, the image will be moved to a new slide automatically.

insert image in rmarkdown

The only elements that can coexist with an image or table on a slide are the slide header and image/table caption. Images and tables will always be placed on new slides. In general, this is a pretty straightforward process and is described in R Markdown: The Definitive Guide. Recently at work, I’ve been building R Markdown documents to generate PowerPoint slides.







Insert image in rmarkdown