Learning the markdown syntax
Markdown is a lightweight markup language; it allows anyone to quickly create a formatted document in plain text instead of using complicated HTML. In this recipe, we introduce how to write a report with markdown syntax.
Getting ready
Ensure you have installed the latest version of R and RStudio on your operating system. Also, you need to have created and opened a new R Markdown (.rmd
) file in RStudio.
How to do it…
Please perform the following steps to write simple markdown syntax:
First, create headings by placing a hashtag
#
in front of the words:Markdown
Preview
# H1
## H2
### H3
Next, emphasize words by style with bold, italics, and strikethrough:
Markdown
Preview
This is plan text:
*italics1*
_italics2_
**bold1**
__bold2__
~~Strikethrough~~
For list items, we can list items in an ordered item list or an unordered item list:
Markdown
Preview
First Ordered list item
Second Ordered List Item
Unordered sub-list
Unordered List Item
Ordered sub-list-1
Ordered...