## R Markdown

Please read through everything and then try the exercises.

This is an R Markdown document. 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>.

The way you can create a file like this in RStudio is: File → New File → R Markdown and then using the default or using a template.

The gray area below is a code chunk containing some code. You can also run the code within the editor area by pressing the green play button. Don't worry right now about what the code is doing, we will cover this later. We just want you to get used to RStudio and RMarkdowns.

```{r setup, message=FALSE}
knitr::opts_chunk$set(echo = TRUE)

head(airquality)

plot(airquality$Temp, airquality$Ozone, col = "salmon")
```

When you click the **Knit** button (at the top of RStudio), a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. 
Next we will show you some code - no worries about understanding it yet, we just want to get you familiar with where code goes. 

When code is in an RMarkdown file chunk, it is saved to a file. When it is in the console, it is not saved. 

The console is useful for installing packages like we just did, this is because we only need to do it once, so we don't usually need to save the code.

## Exercise 

Here we will change small things in `R` code and examine the output it makes. After each change, hit the **Knit** button again.

Here is another code chunk for our exercises. 

```{r}
x <- c(1, 2, 3)
```


1. Go through the code for the plot above and change the color from "purple" to another color. See http://www.stat.columbia.edu/~tzheng/files/Rcolor.pdf for a large list of colors. Make sure to keep the quotation marks!

2. Add a new R chunk below the instructions. You can use the insert chunk button or copy paste an existing code chunk. Include a lowercase `x` inside the chunk as the code. Thus it should look like the chunk above but without `<- c(1,2,3)`. Make sure you press the knit button after this to see what the new chunk looks like.

3. Add Some additional text to the report outside of the code chunks, such as your name.

```{r}
x
```

My name is Bruce Wayne!

  