Skip to content
R for the Rest of Us Logo

RMarkdown Overview

This lesson is locked

Get access to all lessons in this course.

Transcript

Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.

Your Turn

  1. Create a new project. Don't worry too much about what's it called, etc because we'll only use this for a bit to demonstrate how RMarkdown works.

  2. Create a new RMarkdown file, setting the default output format as Word.

  3. Save your RMarkdown file as report.Rmd.

  4. Look through this RMarkdown file and make sure that you can identify the YAML, text sections, and code chunks.

  5. Click the Knit button and open the file that gets produced (report.docx).

Have any questions? Put them below and we will help you out!

You need to be signed-in to comment on this post. Login.

Béatrice Leydier

Béatrice Leydier

March 25, 2021

I've noticed my document by default doesn't include a date and author - I can easily add in manually, but was wondering if it was a setting I should change in my Rstudio app?

Béatrice Leydier

Béatrice Leydier

March 25, 2021

Nevermind - figured out in the next lesson that the author was a case to fill when creating the document, and the date does appear automatically if the author is filled (seems like it is ommitted if the author is as well).

David Keyes

David Keyes

March 25, 2021

Glad you got it figured out!

Yup, you can definitely change it! I'll usually do HTML when I first start something because it's easiest. I'll then later change to a different format depending on what I need for my final deliverable.

Payal Mulchandani

Payal Mulchandani

September 20, 2021

Getting an error which says - Required package version could not be found: caTools 1.14 is not available. What do I need to update ?

Very odd. It looks like you need to update the caTools package. You can do that with this code:

install.packages("caTools")

Patricia Montano

Patricia Montano

January 10, 2022

This is very cool!! I'm looking forward to the next sections and already seeing how this could be time saver.

David Keyes

David Keyes

January 10, 2022

It's my favorite thing about R!

Tatiana Bustos

Tatiana Bustos

July 21, 2022

Had no idea R could do this with reports! VERY COOL

David Keyes

David Keyes

July 21, 2022

Yeah, and you can even make multiple reports at once using RMarkdown! See this article explaining the process and this example of multiple reports we made for a client.

Hatem Kotb

Hatem Kotb

August 3, 2022

Amazing examples, thank you for sharing!

Jonathan Han

Jonathan Han

October 3, 2022

Hi David,

I was experimenting the formats that we could product upon knitting RMarkdown. However, I ran into some trouble while attempting to produce a PDF output.

The error message on the 'compile PDF' tab was — Unable to find specific LaTeX program 'pdfLaTeX' on system path.

Does this mean that I might have to additionally install other packages to enable this?

David Keyes

David Keyes

October 3, 2022

I think this means that RMarkdown is having trouble finding LaTeX, which it needs to compile your document into PDF. Can you please install tinytex using this code and then try again:

install.packages('tinytex')
tinytex::install_tinytex()

Please let me know if that works!