class: center, middle, inverse, title-slide # Short articles with html_document ## RMarkdown --- # Where should we be? Let's create a new project in the course materials as follows: ```r /example-data-projects/short-rmarkdown-article ``` --- # Creating a .Rmd file Navigate to ```r File > New > RMarkdown ``` If everything is plugged in correctly, click "okay"<sup>1</sup> <center><img src='images/RMarkdown-documents.png' width='300px'/></center> .footnote[ [1] If you don't see this, run `install.packages("rmarkdown")` in the console. ] --- background-image: url(images/rmarkdown-annotated.png) background-color: white background-size: contain class: center, bottom, inverse --- # Knitting: Generating output from .Rmd - Always save your .Rmd file before generating output. - Click the knit button <img src='images/knit-button.png' width='400px'/> - A .html file is created in the project directory. --- # markdown in RMarkdown Text in RMarkdown documents is written in **markdown**. This is a *tiny* markup language which has the following features: - Set headings with #, ##, ### - \*italics\* and \*\*bold\*\* markup text, respectively - \[link text\]\(url\) - ... see the [RMarkdown Cheatsheet for more](https://github.com/rstudio/cheatsheets/raw/master/rmarkdown-2.0.pdf) Note that markdown is used for formatting content in StackOverflow, GitHub and many other places - it's worth learning. --- # Code chunks Code chunks are the sections of your document containing R code. Here's a code chunk from the template document: <pre> ```r summary(cars) ``` </pre> --- background-image: url(images/rmarkdown-code-chunk-output.png) background-color: white background-size: contain class: center, bottom, inverse --- # HTML for power users