August 14, 2017

Description of the plot

  • In this presentation, I am going to plot the US car prices against the number of gallons required to travel 100 miles with that car.

  • The color of the points will represent the type of the car, e.g. Sporty, Van, Compact, etc.

  • The size of the points will denote the average number of miles per gallon for driving the car in city. The bigger the size, more the MPG of the car in the city.

Code for the plot

library(plotly)
library(DAAG)
plot_ly(carprice, x = ~gpm100, y = ~Price, mode = "markers",
        color = ~Type, size = ~MPG.city) %>%
  layout(title = 'US Car Prices',
         xaxis = list(title = 
                          'gallons required to travel 100 miles'),
         yaxis = list(title = 'Price for a mid-range model'))

The Plot

Thank You

This was my basic plotly presentation created in R Markdown for the second peer assessment project for the Developing Data Products Course which is a part of the Coursera Data Science Specialization.