Get access to all lessons in this course.
-
RMarkdown
- Why Use RMarkdown?
- RMarkdown Overview
- YAML
- Text
- Code Chunks
- Wrapping Up
-
Data Wrangling and Analysis
- Getting Started
- The Tidyverse
- select
- mutate
- filter
- summarize
- group_by
- count
- arrange
- Create a New Data Frame
- Crosstabs
- Wrapping Up
-
Data Visualization
- An Important Workflow Tip
- The Grammar of Graphics
- Scatterplots
- Histograms
- Bar Charts
- color and fill
- scales
- Text and Labels
- Plot Labels
- Themes
- Facets
- Save Plots
- Wrapping Up
-
Wrapping Up
- You Did It!
Fundamentals of R
YAML
This lesson is locked
This lesson is called YAML, part of the Fundamentals of R course. This lesson is called YAML, part of the Fundamentals of R 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
Reuse the RMarkdown document you made in the last lesson. Then:
Go into the YAML and change the title to “My Super Fancy Report.”
Remove the line with the date from the YAML.
Change the output format to HTML by changing
output: word_document
tooutput: html_document
.Knit again and open report.html to make sure your changes show up.
Learn More
If you are really curious about why YAML is called YAML, here's the definitive answer.
You need to be signed-in to comment on this post. Login.
Eduardo Rodriguez
March 22, 2021
Hi David,
Everything is working great, RMarkdown is a fantastic tool! However, I noticed that when I knit my code it automatically opens the file. It's not a bad thing but I am curious how I change the settings? In your video it doesn't automatically open.
Thank you,
Eduardo Rodriguez
David Keyes
March 22, 2021
Yup, I recorded a quick video to show you how to change this behavior!
Eduardo Rodriguez
March 23, 2021
Hi David,
Appreciate the quick response and simple solution!
Thank you,
Eduardo Rodriguez
Lindsay Quarles
September 30, 2021
As soon as I tried to edit the YAML everything went away and all I see is PK with two red dots. What did I do wrong?
David Keyes
October 1, 2021
Would you mind taking a screenshot and sharing the link using imgur.com or something similar?
Lindsay Quarles
October 7, 2021
I went through the instructions again for a third time and it worked! Not sure what I did wrong, but I got it right this time. Thanks David!
Sam Bird
March 23, 2022
Hi David, I keep getting this error when trying to knit to a html document. I can knit to a word document just fine. I've all tried doing "install.packages("sass") and that didn't seem to fix the problem. Do you have any ideas for what could be causing this?
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package called ‘sass’ Calls: ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart Execution halted
Thanks,
Charlie Hadley
March 23, 2022
Hi Sam! That's not an error I'd expect. Can you create a new .Rmd that contains only this and tell me if you get the same error?
Thanks, Charlie
Sam Bird
March 24, 2022
Hey Charlie! Ya I'm getting the same error. Weird.
Ruth Hogg
September 29, 2022
I'm getting the same error
Ruth Hogg
September 29, 2022
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package called 'sass' Calls: ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart Execution halted
Andrew Paquin
March 18, 2023
Hi David, All of this worked for me, but I notice that my report did not open in a browser immediately as yours did. Instead, it opened in another window that included a button to enable a browser view. Not a big deal; it's just one small extra step. Is it something I should try to fix?
Andrew Paquin
March 18, 2023
Nevermind. I figured it out. The default preview was on.