What affects MPG?

Carlos Mercado

July 10, 2017

Intro

Using mtcars I’ve plotted various features of cars relative to miles per gallon:

R

suppressMessages(library(plotly))
f <- list(
  family = "Courier New, monospace",
  size = 14,
  color = "#7f7f7f"
)
x <- list(
  title = "Cylinders",
  titlefont = f
)
y <- list(
  title = "Miles Per Gallon",
  titlefont = f
)

carsplot <- plot_ly(mtcars,type = "scatter",x = ~cyl, y= ~mpg, color = ~am, mode = 'marker')%>%
        layout(xaxis = x, yaxis = y)

Plot

suppressMessages(carsplot)
## A marker object has been specified, but markers is not in the mode
## Adding markers to the mode...