From the course: Creating Reports and Presentations with R Markdown and RStudio

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Inserting images with include_graphics()

Inserting images with include_graphics() - RStudio Tutorial

From the course: Creating Reports and Presentations with R Markdown and RStudio

Start my 1-month free trial

Inserting images with include_graphics()

- [Instructor] The simplest way to add images to R Markdown documents is with the include graphics function from knitr. Let's show you how we can use that by jumping into our exercise files and going to folder 07_01. In here, we can see a .Rproj file and we can see an Images folder, which contains the quite attractive R Markdown sticker. So let's write an R Markdown document, which shows us this image. So I'll open up to Rstudio project and let's create a new R Markdown file. So we'll go to File, New File, we'll select R Markdown. I'm going to go with HTML document and I'll click OK. We get the same template document from our studio that we get whenever we click on that. And I don't want to use that, so let's wipe away all this content. Let's select from line 10 all the way down to 29 and let's delete that. Let's create another new R Markdown file at the exact same time. Okay, New File, R Markdown, HTML, let's go to Untitled1. We'll select all of the contents of this with Command + A,…

Contents