---
title: "Data_IO_Lab Key"
output: html_document
editor_options: 
  chunk_output_type: console
---

In this lab you can use the interactive console to explore or **Knit** the document. 
Remember anything you type here can be "sent" to the console with Cmd-Enter (OS-X) or Ctrl-Enter (Windows/Linux) in an R code chunk.


# Part 1

1.  Read in the Youth Tobacco study from URL 
http://jhudatascience.org/intro_to_R_class/data/Youth_Tobacco_Survey_YTS_Data.csv
and assign it to a variable named `youth`. 

```{r}
library(readr)
# ??? <- read_csv(???)
```

2. Use `head()` to display the first few rows of the data frame. 

```{r}

```

3. Use `spec()` to display the list of column names and their type specification. 

```{r}

```

4. Load the `readxl` package with the `library()` command. 

If it is not installed, install it via: `RStudio --> Tools --> Install Packages`. 

```{r}

```

5. Download the dataset of monuments from: http://jhudatascience.org/intro_to_R_class/data/Monuments.xlsx file to `Monuments.xlsx`. 

```{r}
download.file("http://jhudatascience.org/intro_to_R_class/data/Monuments.xlsx",
              destfile = "Monuments.xlsx",
              overwrite = TRUE, 
              mode = "wb")
```

6. Use the `read_excel()` function in the `readxl` package to read the `Monuments.xlsx` file and call the output `mon`. 

```{r}

```


# Part 2

7. Learn your working directory by running `getwd()`

```{r}

```

8. Write out the `mon` object as a CSV file calling it "monuments.csv", using `write_csv()`:

```{r}

```


# Bonus

9. Write one of the variables from the Basic R lab to your working directory in `rds` format. Call the file `my_variable.rds`.

```{r}

```
