R Markdown

What is R Markdown: R Markdown is a useful tool that allows you to save and execute code, and generate shareable reports for stakeholders. As you learn more about how to use it, it can be helpful to bookmark some resources to refer to later.


title: “practice”
author: “Floyd”
date: “2023-11-01”
html_document: default
pdf_document: default

File Format:


title: “R Markdown Intro”
author: “Floyd”
date: “2023-11-01”
output: html_document

Element Markdown Example
Headings #, ##, … # Heading 1, ## Heading 2, …
Lists -, *, + - Item 1, * Item 2, + Item 3
Ordered Lists 1., 2., … 1. First item, 2. Second item, …
Links [Link Text](URL) [OpenAI's Website](https://www.openai.com)
Emphasis *, _ *Italicized Text*, **Bold Text**
Blockquotes > > This is a blockquote.
Code inline code Use print("Hello, World!") to display…
Code Blocks language python def greet(name): print(f”Hello,…
Horizontal Rules ---, ***, ___ ---
Images ![Alt text](URL) ![Alt text](https://example.com/image.jpg)
Tables Pipes and hyphens See previous example in the text.
Bold Text ** **Bold Text**
Italics * or _ *Italicized Text*
Caption ![Alt text](URL) "Caption Text" ![Image](image.jpg "Image Caption")

This table format provides an overview of various Markdown elements, including those for

When creating headers keep the following in mind:

Headers will appear in blue

A single hashtag is the largest header

The more hashtags you add (up to six), the smaller the header

To format comments in your notebook, follow these steps:

1. Click in a line above the code chunk you added but below the YAML section.

2. Type a main header for your report using a single hashtag. You might want to restate the title in the YAML in a different way or add to it with a short description.

3. Add a smaller header below that to label the first part of your programming. Follow that with a description of the code chunk that you added.

Headings in Markdown are used to organize your content and create a hierarchy. Markdown supports six levels of headings, with “##” for the second level, “###” for the third level, and so on. Here’s an example:


Headings in Markdown are used to organize your content and create a hierarchy. Markdown supports six levels of headings, with “##” for the second level, “###” for the third level, and so on. Here’s an example:

# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6


Markdown supports both ordered and unordered lists. To create an unordered list, use asterisks, plus signs, or hyphens as list markers:

- Item 1
- Item 2
- Subitem 1
- Subitem 2
* Item 3
+ Item 4

For ordered lists, use numbers followed by periods:

1. First item
2. Second item
3. Third item


Creating hyperlinks in Markdown is simple. Use square brackets for the link text and parentheses for the URL:

[OpenAI's Website](https://www.openai.com)

You can also add optional title attributes to your links:

[Google](https://www.google.com "Google Homepage")


Markdown allows you to emphasize text in two ways: italics and bold. To italicize text, enclose it with asterisks or underscores:

*Italicized Text*
_Italicized Text_

For bold text, use double asterisks or underscores:

**Bold Text**
__Bold Text__


Blockquotes are used to emphasize and distinguish quoted text. Simply prefix the text with a greater-than sign (>):

> This is a blockquote.


To format inline code, wrap the code snippet in backticks ():

Use print("Hello, World!") to display a message.

For code blocks, use triple backticks with the language identifier for syntax highlighting:

<pre> python def greet(name): print(f”Hello, {name}!”) ` </pre>

Horizontal Rules

To create a horizontal rule, use three or more hyphens, asterisks, or underscores on a separate line:



Including images in your Markdown document is similar to creating links, but with an exclamation mark in front of the square brackets:

![Alt text](https://example.com/image.jpg "Image Title")


Tables can be created using pipes (|) and hyphens. Use pipes to separate columns and hyphens to define the header row:

| Header 1 | Header 2 |
| Data 1 | Data 2 |
| Data 3 | Data 4 |

Markdown is a versatile and efficient way to format and structure text for various purposes, from writing documentation and blog posts to taking notes and creating README files. With these essential Markdown options in your toolkit, you can enhance your text and make it more readable and informative. Happy Markdown writing!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top