plot of chunk plot-play-by-down  Continuing with the newly
available football data and inspired by a question from Drew
Conway I decided to look at play selection based on down by the
Giants for the past 10 years.  Visually, we see that until 2011
the Giants preferred to run on first and second down.  Third
down is usually a do-or-die down so passes will dominate on
third-and-long.  The grey vertical lines mark Super Bowls XLII
and XLVI.  Code for the graph after the break.  The packages to
be used are:  require(plyr) require(stringr) require(ggplot2)
require(reshape2) require(parallel) require(doParallel)   We
will be running this in parallel so let’s register a parallel
backend.  cl <- makeCluster(2) registerDoParallel(cl)   First we
read the data for all available years.  theFiles <-
file.path("../data", dir("../data/")) # read the csvs in
parallel system.time(allGames <- adply(theFiles, .margins = 1,
read.csv2, header = TRUE, sep = ",", stringsAsFactors = FALSE,
.parallel = TRUE)) # took 10.98 seconds on