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

Investigating the makes and models of automobiles

With the first set of questions asked and answered about this dataset, let's move on to additional analyses.

Getting ready

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

How to do it...

This recipe will investigate the makes and models of automobiles and how they have changed over time:

  1. Let's look at how the makes and models of cars inform fuel efficiency over time. First, let's look at the frequency of the makes and models of cars available in the US over this time and concentrate on four-cylinder cars:
    carsMake <- ddply(gasCars4, ~year, summarise, numberOfMakes = length(unique(make)))
    
    ggplot(carsMake, aes(year, numberOfMakes)) + geom_point() + labs(x = "Year", ...

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