We'll continue to work on the same .Rmd file from the previous exercise.    

<hr> 

```{r, echo = FALSE, warning = FALSE, message = FALSE}
library(tidyverse)
library(dcData)

data("BabyNames", package = "dcData")
BabyNamesSupp <- 
  read_csv("https://github.com/jbpost2/Basics-of-R-for-Data-Science-and-Statistics/raw/master/datasets/BabyNamesSupp.csv",
           col_types = cols(sex = col_character()))  # fixes `sex`
BabyNamesFull <- bind_rows(BabyNames, BabyNamesSupp)
```

# 8.1 Widening Data  

1. We are going to 'widen' that data by taking the observations for the names 'Shannon' and 'Lindsay' and make one row that has the counts for both `M` and `F` observations.  Add a brief section of text corresponding to this goal.

2. Filter the `BabyNamesFull` data object to only include the names 'Shannon' and 'Lindsay'.  Then use the `pivot_wider()` function to create a wider data set as noted above.

```{r}
BabyNamesFull %>% 
  filter(name %in% c("Shannon", "Lindsay")) %>%
  pivot_wider(names_from = sex, values_from = count)
```

<hr>

<br>

<a href = "https://jbpost2.github.io/Basics-of-R-for-Data-Science-and-Statistics/CourseFiles.html"><button type="button">Course Files Page</button></a>
