Skip to content
R for the Rest of Us Logo

This lesson is locked

Get access to all lessons in this course.

If the video is not playing correctly, you can watch it in a new window

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. Working in your report.qmd file, delete the default content (everything below the YAML).

  2. Add a first-level Heading that says "Introduction"

  3. Add this text below the Introduction first-level heading (note the bold and italics):

    This report is about three species of penguins

    1. Adele

    2. Gentoo

    3. Chinstrap

    You'll learn so much about the penguins. I hope you're ready!

Finally, render your report again and make sure you see the changes.

Learn More

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

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

Jessica France

Jessica France

September 29, 2023

Hi! I tried doing the 1. to get the ordered list, but it just isn't working. Kindly find my code below:

title: "My Penguins Report" author: "Jessica France" format: html

Introduction

“ This report is about three species of penguins

1.‘Adele’ 1.‘Gentoo’ 1.‘Chinstrap’

You’ll learn so much about penguins. I hope you’re ready!”

Gracielle Higino

Gracielle Higino Coach

September 29, 2023

Hi Jessica! A common thing that happens that messes up with formatting is the lack of spaces between elements or between paragraphs. In your case, it seems like there's a space missing between the 1. and the words after. Try adding a space there and let us know if it works!

Brian Slattery

Brian Slattery

October 4, 2023

I'm guessing this is something we might talk about later, but how do we change the default formatting (e.g. changing the font, having the headers red instead of blue, etc). I was guessing that this would be in a different part of the process because the source and rendering are being split up (like HTML vs CSS) but I was having a hard time figuring this out via Google. It seems like for HTML output you would literally have a CSS file as well? Is there an equivalent for Word, PDF, or other formats?

Gracielle Higino

Gracielle Higino Coach

October 4, 2023

Hi Brian! This is a great question and the short answer is YES! We are going to learn more about it in the last few weeks of the course, and we also need "style files" to be used as templates for our documents. For HTML this means a CSS file, for PDF you can use a LaTeX, and for Word, you can use another Word document.

Some things can be done using HTML notation for HTML outputs, but that's rarely used because that's the opposite of what we want with reproducible reports, right? We want to change the content, not the format.

We can chat about it in a co-working session!

Gayathri Mahendran

Gayathri Mahendran

January 21, 2024

Hello, I can't preview my reports in the viewer pane. I have set the options to 'Preview in Viewer Pane'. Is there something else that I should change? Every time I render I can't see a thing in my Viewer pane, but the output file opens up immediately.

David Keyes

David Keyes Founder

January 21, 2024

What format are you trying to render to?

Gayathri Mahendran

Gayathri Mahendran

January 22, 2024

Hi David, Thank you for your response. I was looking look render to HTML format. It didn't seem to show up in the viewer pane. Later, I closed and restarted my R session and then it did work.

David Keyes

David Keyes Founder

January 23, 2024

Glad it worked!

Valliappan Muthu

Valliappan Muthu

April 3, 2024

Hi David, Unable to view the html in the preview pane, even after restarting the session. Please guide!

Libby Heeren

Libby Heeren Coach

April 3, 2024

Hey, Valli! In RStudio, at the top of your source pane (where your .qmd file is open), there is a small gear icon with a down-arrow next to it. If you click that, you'll see an option for "Preview in Viewer Pane" there. Try selecting that and seeing if your subsequent HTML output is rendered in the viewer pane.

Valliappan Muthu

Valliappan Muthu

April 3, 2024

It worked! Thanks

Leo Gutknecht-Gmeiner

Leo Gutknecht-Gmeiner

April 3, 2024

I have the same problem as someone from the last course: My reports do not show in the viewer pane, but open up separately. How can I change this?

Libby Heeren

Libby Heeren Coach

April 3, 2024

Hi, Leo! In RStudio, at the top of your source pane (where your .qmd file is open), there is a small gear icon with a down-arrow next to it. If you click that, you'll see an option for "Preview in Viewer Pane" there. Try selecting that and seeing if your subsequent HTML output is rendered in the viewer pane. And for doing both bold and italic, you'll just combine the notation or add an extra set of asterisks:

*this is italic*  
**this is bold**  
***this is bold and italic*** 

Leo Gutknecht-Gmeiner

Leo Gutknecht-Gmeiner

April 3, 2024

Another thing: what if I want a text in italics and bold?

Valliappan Muthu

Valliappan Muthu

April 3, 2024

I think it is bold and italics

Valliappan Muthu

Valliappan Muthu

April 3, 2024

*** words***

Gabby Bachhuber

Gabby Bachhuber

April 4, 2024

My RStudio is actually formatting everything for me! It starts as a header; I didn't even need to use "#". When I typed "1." and hit enter, the next line showed as "2." The only thing I did need to do was the bold and italics. Is that a new feature of RStudio (mine is 4.3.2)?

Libby Heeren

Libby Heeren Coach

April 4, 2024

Hey, Gabby! It sounds like you might be in the visual editor! At the top of your source pane, there will be two buttons that say Source and Visual to switch between the two. If you click Source, it should change back to being pure unstyled code.