Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
R markdown -> Literate Programming + Dynamic Documents + Reproducible Research
We can produce outputs in PDF,HTML, Word, Powerpoint formats from a Markdown Document.
Sample YAML header that contains some metadata
---
title: "Hello World"
author: "Srini"
date: "January 1, 2015"
output: html_document
---
R code chunks surrounded by ```{r} and ```; a syntax that comes with the knitr package
```{r}
summary(mtcars)
```
You can also embed plots, for example:
```{r, echo=FALSE}
plot(mtcars)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
You can use Markdown to embed formatting instructions into your text.
Italics -> *italics*
Bold the text ->**bold**
Code Style ->`code`
Hyperlink -> [RStudio](www.rstudio.com)
Headers
To create titles and headers, use leading hashtags. The number of hashtags determines the header's level
# First level header
## Second level header
### Third level header
To make a bulleted list in Markdown, place each item on a new line after an asterisk and a space, like this:
* item 1
* item 2
* item 3
You can make an ordered list by placing each item on a new line after a number followed by a period followed by a space, like this
1. item 1
2. item 2
3. item 3
In each case, you need to place a blank line between the list and any paragraphs that come before it.
You can also use the Markdown syntax to embed latex(https://en.wikibooks.org/wiki/LaTeX/Mathematics) math equations into your reports. To embed an equation in its own centered equation block, surround the equation with two pairs of dollar signs like this,
$$1 + 1 = 2$$
To embed an equation inline, surround it with a single pair of dollar signs, like this: $1 + 1 = 2$.
R markdown -> Literate Programming + Dynamic Documents + Reproducible Research
We can produce outputs in PDF,HTML, Word, Powerpoint formats from a Markdown Document.
Sample YAML header that contains some metadata
---
title: "Hello World"
author: "Srini"
date: "January 1, 2015"
output: html_document
---
R code chunks surrounded by ```{r} and ```; a syntax that comes with the knitr package
```{r}
summary(mtcars)
```
You can also embed plots, for example:
```{r, echo=FALSE}
plot(mtcars)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
You can use Markdown to embed formatting instructions into your text.
Italics -> *italics*
Bold the text ->**bold**
Code Style ->`code`
Hyperlink -> [RStudio](www.rstudio.com)
Headers
To create titles and headers, use leading hashtags. The number of hashtags determines the header's level
# First level header
## Second level header
### Third level header
To make a bulleted list in Markdown, place each item on a new line after an asterisk and a space, like this:
* item 1
* item 2
* item 3
You can make an ordered list by placing each item on a new line after a number followed by a period followed by a space, like this
1. item 1
2. item 2
3. item 3
In each case, you need to place a blank line between the list and any paragraphs that come before it.
You can also use the Markdown syntax to embed latex(https://en.wikibooks.org/wiki/LaTeX/Mathematics) math equations into your reports. To embed an equation in its own centered equation block, surround the equation with two pairs of dollar signs like this,
$$1 + 1 = 2$$
To embed an equation inline, surround it with a single pair of dollar signs, like this: $1 + 1 = 2$.
Comments
Post a Comment