Skip to content
R for the Rest of Us Logo

Fundamentals of R

Text

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.

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!

Valliappan Muthu

Valliappan Muthu • May 22, 2024

Hello I am facing similar problem , both with and without space the numbering and bullet list is not working:

Input You can use bullet or numbers

  1. Number 5
  2. Number 6

or 1.list 2.list

The output was:

You can use bullet or numbers 1. Number 5 2. Number 6

or 1.list 2.list

David Keyes

David Keyes Founder • May 22, 2024

Make sure to put a space after the period. Let me know if that helps!

Valliappan Muthu

Valliappan Muthu • May 23, 2024

Hi, I did that and keep getting a similar output "Introduction A document on penguins for training

Reporting on three penguin species 1. Adelie 1. Gentoo 1. Chinstrap"

Has it got something to do with any settings of rmarkdown?

David Keyes

David Keyes Founder • May 23, 2024

It shouldn't have anything to do with settings. Could you please post your markdown text here? Please make sure to add three backticks before and after it in order to make it formatted correctly on the website.

Valliappan Muthu

Valliappan Muthu • May 23, 2024

# Introduction
A document on penguins for training

Reporting on **three** penguin species
1. Adelie
1. Gentoo
1. Chinstrap

Good to learn *so* much about ***penguins***
David Keyes

David Keyes Founder • May 23, 2024

Ah, I see the issue! You need to add a line break after the "Reporting on ..." line. Like this:

# Introduction
A document on penguins for training

Reporting on **three** penguin species

1. Adelie
1. Gentoo
1. Chinstrap

Good to learn *so* much about ***penguins***

Generally speaking, you want to add line breaks before and after each item. Hope that fixes it for you!

Valliappan Muthu

Valliappan Muthu • May 23, 2024

Great! thanks it worked.

Another bothering issue I have been trouble seeing my figures seen in the viewer pane - what should be done for this??

Valliappan Muthu

Valliappan Muthu • May 23, 2024

SOrted these both..Thanks David

Libby Heeren

Libby Heeren Coach • May 23, 2024

Glad it's sorted out! What ended up being the problem with your plots not displaying in the Plots pane?

Valliappan Muthu

Valliappan Muthu • May 23, 2024

Hi,

I have been storing them as objects directly and plots were not seen on the viewer pane if stored as objects

Brian Slattery

Brian Slattery • October 3, 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 3, 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 2, 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 2, 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 3, 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 3, 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.

Valliappan Muthu

Valliappan Muthu • May 29, 2024

Hello, I tried to create the following using quarto

  1. Main list • Subheading 1 • Subheading 2 • Subheading 3
  2. Second list • Subheading a • Subheading b
  3. Third list

But when I do that, I get:

  1. Main list • Subheading 1 • Subheading 2 • Subheading 3
  2. Second list • Subheading a • Subheading b
  3. Third list

My code was

1. Main list
Subheading 1
Subheading 2
Subheading 3

1. Second list
  - Subheading a
Subheading b
  
1. Third list
David Keyes

David Keyes Founder • May 30, 2024

Try adding line breaks before and after each line. That should fix it.