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 URL based images using raw LaTeX - RStudio Tutorial
From the course: Creating Reports and Presentations with R Markdown and RStudio
Inserting URL based images using raw LaTeX
- [Man] Inserting images from URLs in PDF documents using R Markdown is slightly harder than when creating HTML with R Markdown. let's have a look at why by going to our exercise files and loading folder 07_04, and opening up our RStudio project. Okay, let's open up our R Markdown file here, and let's concentrate on a file by pressing Control + Shift + 1. Okay, so what this document does is it uses the rvest Package to download the google.com/doodles page and it extracts the URL of the latest doodle for us. Okay, let's knit this together and see what we get. This knits together, and we get the URL of our image. There's no consistent and easy way in LaTeX, that's Lore LaTeX, to extract the image from this URL and display it in the PDF. It's much simpler if we write our code to download this image, and then display the download image with include graphics. So, let's do that together. We'll insert a new code chunk, by clicking Insert, and selecting R, and we'll use the function…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.