-
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
Text
This lesson is called Text, part of the Fundamentals of R course. This lesson is called Text, 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
Working in your report.Rmd file, above the RMarkdown second-level header, add the following first-level header: “Introduction”
Add this text (note the bold and italics) below the introduction header: “This report is the best report ever. Pretty much the bees’ knees. Can’t say that I’ve ever seen a better report.”
Add the following second-level header: “Reasons Why This Report is the Best”
Add the following list of reasons why the report is the best:
It’s amazing
It’s quite amazing
It’s seriously amazing
Knit again and reopen the report.html file to make sure your changes show up.
Learn More
A review of the basics of Markdown text can be found on the RStudio website.
You need to be signed-in to comment on this post. Login.
ODILE DOREUS
August 8, 2021
Hi David, I done all exercises and the output worked well for me but my report does not appear in the 4th window of R under files tabs. It's pop up the first time but for changes I have to go on my destktop were I saved the file so I can open it back and see the changes.
David Keyes
August 9, 2021
Can you please take a screenshot and show it to me? You can upload to imgur.com and post the link.
Craig Loschmann
September 17, 2021
In terms of formatting in RMarkdown, are you going to cover the Visual Markdown Editor?
Similarly, are there ways to change alignment (e.g. center a title) in the output?
David Keyes
September 17, 2021
We'll talk about the visual editor next week. As you may have realized, I made this video before the visual editor existed.
In terms of centering content, it depends what format you're knitting to. For HTML, you do this with CSS. For Word, you do this with reference documents (you can see this in the lesson titled Making Your Reports Shine: Word Edition). You can also do it with the
officer
orofficedown
packages, I believe.Hope that helps!
Lindsay Quarles
October 7, 2021
I did it but only some of the formatting codes worked. Here's the code I wrote and here's the output I got, https://imgur.com/a/KBj61Vg.
Lindsay Quarles
October 11, 2021
I was just wondering if you could help me understand what I did wrong with my code? Here’s the code I wrote and here’s the output I got, https://imgur.com/a/KBj61Vg.
Charlie Hadley
October 12, 2021
Hi @Lindsay sorry for missing this question! The issue is because RMarkdown needs an empty line between distinct pieces of content, here's a video showing how to fix it https://share.getcloudapp.com/v1ujK8xz
Lindsay Quarles
October 12, 2021
That did it! Thank you so much Charlie!
Niger Sultana
May 1, 2022
Hi If I want Header both Italic and bold, like *Introduction. It did not work. Can you please let me know.
Cheers Niger
Charlie Hadley
May 3, 2022
Hello Niger,
Which output type are you using? I think this might not work for all output formats. You might instead want to use HTML (if you're using an HTML output), eg
Hatem Kotb
August 3, 2022
Interesting to see that there is a 'Visual' interface in Rstudio now feeling spoiled :D
Charlie Hadley
August 4, 2022
I was initially hesitant about using the visual interface, but it's actually very good.