Fuel Efficiency per Horsepower range

25/08/2017

Introduction

As a simple way of getting an idea of the fuel efficiency of a car I am going to buy, I though of plotting a simple predictor (horsepower) that was easy to visualize and useful when car-shopping to give me an idea of the MPG. My chosen dataset was R's mtcars.

I then decided to allow the user to use a slider to get the range of horsepower that is looking to buy and see with their own eyes, the MPG expected [more or less].

summary(mtcars$mpg)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  10.40   15.43   19.20   20.09   22.80   33.90 

Plotting the full dataset

This is the full plot.

plot of chunk full graph

Example of horsepower between 100 and 200

This is the example plot that you would get by selecting the range with the slider, the values 100 and 200 for minimum and maximum horsepower, respectively.

plot of chunk hp graph

My Shiny App