---
output: pdf_document
---

Airline Delays in the First Course (part 1: accessing the data from Boston)
========================================================
Nicholas Horton, nhorton@amherst.edu, July 31, 2014
------------------------------------------------------

#### Accessing the data

```{r,message=FALSE, eval=TRUE, echo=FALSE}
require(dplyr)
my_db = src_mysql(host = "rucker.smith.edu", user = "mth292",
  password = "XX", dbname="airlines")
```
```{r,message=FALSE, eval=FALSE, echo=TRUE}
require(dplyr)
my_db = src_mysql(host = "rucker.smith.edu", user = "mth292",
  password = "XX", dbname="airlines")
```
```{r}
my_tbl = tbl(my_db, "ontime")
bosFlights = my_tbl %>%
    filter(Origin=="BOS" & Year > 2010 & Month==8) %>%
    select(DayofMonth, Month, Year, Origin, Dest, UniqueCarrier, 
           TailNum, CRSDepTime, ArrDelay, Cancelled)
dim(bosFlights)
```

```{r, tidy=TRUE}
save(bosFlights, file="JSM-BOS.rda")
```
