We have now successfully imported the data and looked at some important high-level statistics that provided us with a basic understanding of what values are in the dataset and how frequently some features appear. With this recipe, we continue the exploration by looking at some of the fuel efficiency metrics over time and in relation to other data points.
The following steps will use both plyr
and the graphics library, ggplot2
, to explore the dataset:
- Let's start by looking at whether there is an overall trend of how MPG changes over time on average. To do this, we use the
ddply
function from theplyr
package to take thevehicles
data frame, aggregate rows by year, and then, for each group, we compute the mean highway, city, and combine fuel efficiency. The result is then assigned to a new data frame,mpgByYr
. Note that this is our...