DataFest example (part 2: reading data and generating some plots)
========================================================
Nicholas Horton, nhorton@amherst.edu, March 26, 2014
------------------------------------------------------

#### Read in the data

```{r,eval=TRUE,message=FALSE}
require(mosaic); trellis.par.set(theme=col.mosaic()); options(digits=3)
load("PREPROCESSED")    # contains ds dataframe from first part
```

```{r}
tally(~ Dest, data=ds)
ds = subset(ds, Dest != 'BOS' & Dest != 'GRR')
tally(~ Dest, data=ds)
```

```{r}
head(ds)
subset(ds, ArrDelay > 400)
```

```{r}
densityplot(~ ArrDelay | Dest, data=ds)
small = subset(ds, Dest=='CLT' | Dest=='DCA' | Dest=='ATL' | Dest=='ORD')
densityplot(~ ArrDelay | Dest, data=small)
favstats(ArrDelay ~ Dest, data=small)
densityplot(~ ArrDelay, groups=Dest, auto.key=TRUE, xlim=c(-60, 200), data=small)
```

```{r}
bwplot(ArrDelay ~ as.factor(Month) | Dest, data=small)
bwplot(ArrDelay ~ as.factor(Month) | Dest, ylim=c(-60, 240), data=small)
xyplot(ArrDelay ~ Month, groups=Dest, auto.key=TRUE, type=c("smooth"), ylim=c(-20, 30), span=1/3, data=small)

```