26 de agosto de 2017

Synopsis

This document shows in an interactive map relationship of Mile per Galon (MPG), weight, horsepower and type o transmission from the mtcars database.

This presentation has been re-compiled on:

[1] "agosto 26 2017"

Creating the plot

options(warn=-1)
library(plotly)

mtcars$am<-as.factor(mtcars$am)
levels(mtcars$am)<-c("automatic","manual")

p<-plot_ly(x= ~mtcars$mpg, y= ~mtcars$wt, z=~mtcars$hp, color = ~mtcars$am,
           text=rownames(mtcars), type="scatter3d", mode = "markers") %>% 
           layout(title = "Relationship between MPG, Weight, 
                           HP and Transmission type", 
                  scene = list(xaxis = list(title = "MPG"),
                               yaxis = list(title = "Weight (100 lbs)"),
                               zaxis = list(title = "HorsePower")))

PLOT