Skip to content

Instantly share code, notes, and snippets.

@zekrom-vale
Created February 23, 2020 17:39
Show Gist options
  • Save zekrom-vale/d3504cfbef5e90eb2dbfa65bbf519386 to your computer and use it in GitHub Desktop.
Save zekrom-vale/d3504cfbef5e90eb2dbfa65bbf519386 to your computer and use it in GitHub Desktop.
---
title: "Takeaway 1:Markdown Review 2 2.23.2020"
output:
html_document:
highlight: null
mathjax: null
---
Markdown is a versatile markup syntax that allows us to make good looking reports and API documentation. R markdown is an extension to markdown, meaning you can use any markdown syntax with R markdown.
## New Paragraph
Markdown merges lines together to create a single paragraph.
This was one line, but was merged with the previous line.
Sometimes that is nice, but not always.
```
Markdown merges lines together to create a single paragraph.
This was one line, but was merged with the previous line.
Sometimes that is nice, but not always.
```
To disable this simply use two new lines.
This is a new paragraph.
```
To disable this simply use two new lines.
This is a new paragraph.
```
## Lists
### Unordered lists
To define an unordered list simply use `-` or `*` at the beginning of a line as such:
```
* Item
* Thing
* It
```
* Item
* Thing
* It
### Ordered lists
To use ordered lists simply use the letter, number, or roman numeral folowed by a `.` or `)`. Just use it like the unordered list.
```
1) One
2) Two
3) Three
```
1) One
2) Two
3) Three
### Sub-Lists
Markdown even supports sub-lists simply by indenting the list.
```
1) One
* 1
* I
* A
* a
2) Two
* 2
* II
* B
* b
3) Three
* 3
* III
* C
* c
```
1) One
* 1
* I
* A
* a
2) Two
* 2
* II
* B
* b
3) Three
* 3
* III
* C
* c
## Horizontal lines
Sometimes it is useful to include a horizontal line to break up content, like after heading 1. Simply use `***` on a new line. Some implementations of markdown use `---` instead of `***`.
```
#### Heading 4
***
##### Heading 5
```
#### Heading 4
***
##### Heading 5
## Quotes
Quotes are a simple way to indicate somthing from another source. Simply use the `>` like below:
```
> Post at least one takeaway and at least one thing that you found confusing about the material we discussed in class today. If you didn't find anything that was confusing, you should say so.
> Each takeaway will be graded separately, so you should make clear where they begin and end, either by spacing them apart or by numbering them. The grade for the post will be the average of the grades of each takeaway.
David Romano
```
> Post at least one takeaway and at least one thing that you found confusing about the material we discussed in class today. If you didn't find anything that was confusing, you should say so.
> Each takeaway will be graded separately, so you should make clear where they begin and end, either by spacing them apart or by numbering them. The grade for the post will be the average of the grades of each takeaway.
David Romano
## Tables
Tables are not part of the markdown standard, but have been adopted by many implementations including github. Unless changed recently, this will not work on stack overflow. Use is simple, just divide columns with `|` and indicate headers with `-`. As show below:
```
header 1 | header 2 | header 3 | header 4
---------|-----------|-----------|----------
value 1,1| value 1,2 | value 1,3 | value 1,4
value 2,1| value 2,2 | value 2,3 | value 2,4
value 3,1| value 3,2 | value 3,3 | value 3,4
value 4,1| value 4,2 | value 4,3 | value 4,4
value 5,1| value 5,2 | value 5,3 | value 5,4
value 6,1| value 6,2 | value 6,3 | value 6,4
```
header 1 | header 2 | header 3 | header 4
-----------|------------|------------|-----------
value 1,1| value 1,2 | value 1,3 | value 1,4
value 2,1| value 2,2 | value 2,3 | value 2,4
value 3,1| value 3,2 | value 3,3 | value 3,4
value 4,1| value 4,2 | value 4,3 | value 4,4
value 5,1| value 5,2 | value 5,3 | value 5,4
value 6,1| value 6,2 | value 6,3 | value 6,4
## Links
To embed links simply paste the URL in the markdown and it will automaticaly get turned into a link. To use the link like you see in browsers use the format `[text](URL)`.
```
[See more about Rmd!](https://rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf)
```
[See more about Rmd!](https://rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf)
## Rmd exclusive
### Inline evaluation
Rmd supports inline evaluation like 2+2=`r 2+2`. Simply define inline code and include r or another language at the start as follows:
```
`r 2+2`
```
Note that Rmd will evaluate inline chunks even in chunks.
### LaTeX Equations
LaTeX is a syntax to write math equations in plan text, it can be used with `$` surrounding the equation.
```
$A=\pi*r^{2}$
```
$A=\pi*r^{2}$
Not compatible without js
###### Compiled with knitter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment