-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path02-eda.Rmd
74 lines (52 loc) · 998 Bytes
/
02-eda.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
title: 'Chapter 2: Exploratory Data Analysis'
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Introduction
```{r}
library(ggplot2)
library(dplyr)
library(resampledata)
```
## Basic Plots
```{r}
data("FlightDelays")
glimpse(FlightDelays)
```
```{r}
FlightDelays %>%
group_by(Carrier) %>%
summarize(nflights = n())
```
```{r}
FlightDelays %>%
ggplot(aes(x = Carrier)) +
geom_bar()
```
```{r}
FlightDelays %>%
group_by(Carrier, Delayed30) %>%
summarize(nflights = n())
```
```{r}
FlightDelays %>%
filter(Carrier == "UA") %>%
mutate(time_interval = cut(Delay, breaks = seq(-50, 450, by = 50))) %>%
group_by(time_interval) %>%
summarize(nflights = n())
```
```{r}
FlightDelays %>%
filter(Carrier == "UA") %>%
ggplot(aes(x = Delay)) +
geom_histogram(binwidth = 50)
```
## Numeric Summaries
```{r}
```
## Quantiles and Normal Quantile Plots
## Empirical Cumulative Distribution Functions
## Scatterplots