```{r global_options, include = FALSE}
#### Load any necessary libraries here. I've already loaded the basics
library(magrittr)
library(tidyverse)
library(broom)
library(conflicted)

filter <- dplyr::filter

knitr::opts_chunk$set(echo = TRUE, fig.align ="center", 
                      fig.height = 4.5, fig.width = 4.5)
```

## Exploratory Data Analysis

## Introduction

Here's where you'll explain your data. Where is it from and what's a little bit of the background. Then you need to explain the columns (variables) in the dataset:
  
- **column1:** description
- **column2:** description
- **column3:** description
- etc.

<br><br>

## Data Preparation

Describe here what you did to clean the data.

```{r}
### Use this chunk to read in the data and clean it
scoobydoo <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-07-13/scoobydoo.csv')
```

```{r}
scoobydoo %>%
  mutate(imdb = as.numeric(ifelse(imdb == 'NULL', NA, imdb)),
         engagement = as.numeric(ifelse(engagement == 'NULL', 
                                        NA, imdb))) -> scoobydoo_tidy
```

- Do some series have a higher IMDB rating? Or IMDB engagement?
- Is there more engagement for older shows vs newer scooby do series?
- Are any of the monsters real?
- Combine the captured columns? combine the unmask columns? snack columns?
- Do shows that use `if_it_wasnt_for` have higher engagement?

<br><br>

## Questions

For each question, make a plot illustrating the question, use a statistical to answer the question, and describe your conclusions.

#### Question #1: Do shows that use `if_it_wasnt_for` have higher engagement?

DESCRIBE YOUR RESULTS HERE

```{r}
### imdb rating
scoobydoo_tidy %>% 
  mutate(if_it_wasnt_for2 = ifelse(if_it_wasnt_for == 'NULL', 'no', 'yes')) %>%
ggplot(aes(x = imdb)) +
  geom_density(aes(color = if_it_wasnt_for2)) +
  theme_classic()
```

```{r}
### use this chunk to conduct a statistical test to answer your question
scoobydoo_tidy %>% 
  mutate(if_it_wasnt_for2 = ifelse(if_it_wasnt_for == 'NULL', 'no', 'yes')) %$%
  chisq.test(imdb, if_it_wasnt_for2) %>% 
  tidy()
```

**Rinse and repeat for another 9 questions**

## References
1. Reference should be for your dataset(s), but if you looked up more information that you included in the introduction, please reference it here as well.



<br>


