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.

Run HTML in R Markdown

Run HTML in R Markdown - RStudio Tutorial

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

Start my 1-month free trial

Run HTML in R Markdown

- [Instructor] Let's take a look at how we can insert HTML into our R Markdown documents for formatting our document. We'll go to our Exercise_Files and folder 11_04. Let's open our last Studio project. And we'll open our Markdown file straight away and I want to knit it, to see what it looks like. Okay, so, when we knit it together, we get slightly unexpected output here. We've got two boxes which each take up half the width of my screen, and they've got the image HTML tag, so what I should be seeing is the knitr sticker to the left of the R Markdown sticker. Let's have a look at the .Rmd file and see what's going on here. So, we'll press Control + Shift + 1 to focus on the R Markdown document. And, okay, here's the issue here. On lines 20 through 22, the indentation of center has been interpreted by R Markdown as a blockquote. We want to tell our Markdown to stop interpreting Markdown from line 18 through 29. We do that with a very special HTML comment. So, I put another new line…

Contents