O'Reilly logo

Practical Data Science Cookbook by Abhijit Dasgupta, Benjamin Bengfort, Sean Patrick Murphy, Tony Ojeda

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Analyzing automobile fuel efficiency over time

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.

Getting ready

If you completed the previous recipe, you should have everything you need to continue.

How to do it...

The following steps will use both plyr and the graphing library, ggplot2, to explore the dataset:

  1. Let's start by looking at whether there is an overall trend of how MPG changes over time on an average. To do this, we use the ddply function ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required