---
title: "Exploring Data"
subtitle: "EMSE 4572/6572: Exploratory Data Analysis"
format: html
---

```{r}
#| label: setup
#| include: false

knitr::opts_chunk$set(
    warning = FALSE,
    message = FALSE,
    fig.path = "figs/",
    fig.width = 7.252,
    fig.height = 4,
    comment = "#>",
    fig.retina = 3
)

# install.packages('HistData')
# install.packages('palmerpenguins')
# install.packages('GGally')

# Load packages
library(HistData)
library(GGally)
library(palmerpenguins)
library(tidyverse)
library(here)

# Set the global ggplot theme
theme_set(theme_bw(base_size = 20)) # Set theme for all ggplots

# Read in data
milk_production <- read_csv(here('data', 'milk_production.csv'))
lotr_words <- read_csv(here('data', 'lotr_words.csv'))
marathon <- read_csv(here('data', 'marathon.csv'))
wildlife_impacts <- read_csv(here('data', 'wildlife_impacts.csv'))
faithful <- read_csv(here('data', 'faithful.csv'))
candy_rankings <- read_csv(here('data', 'candy_rankings.csv'))
msleep <- read_csv(here('data', 'msleep.csv'))
```



# Practice with summary measurements

1) Read in the following data sets:

- milk_production.csv
- lotr_words.csv

 2) For each variable in each data set, if possible, summarize its

- Centrality
- Variability

```{r}
# milk_production:


# lotr_words

```



# Practice with visual summaries

1) Read in the following data sets:

- faithful.csv
- marathon.csv

2) Summarize the following variables using an appropriate chart (bar chart, histogram, and / or boxplot):

- faithful: eruptions
- faithful: waiting
- marathon: Age
- marathon: State
- marathon: Country
- marathon: `Official Time`

```{r}
# faithful: eruptions


# faithful: waiting


# marathon: Age


# marathon: State


# marathon: Country


# marathon: `Official Time`

```




# Correlation

Using the `penguins` data frame:

1. Find the two variables with the largest correlation in absolute value (i.e. closest to -1 or 1).

2. Create a scatter plot of those two variables.

3. Add an annotation for the Pearson correlation coefficient.

```{r}
# Write code here
```



# Practice doing EDA

1) Read in the candy_rankings.csv data sets

2) Preview the data, note the data types and what each variable is.

3) Visualize (at least) three _relationships_ between two variables (guided by a question) using an appropriate chart:

- Bar chart
- Scatterplot
- Boxplot

```{r}

```
