Part of JHU- Data Science Specialization Assignment on plotly

mtcars dataset from datasets library in R is used for the plot

plot drawn mpg Vs HP for 4, 6, 8 cyliders respectively

library(datasets)
library(ggplot2)
library(dplyr)
library(rmarkdown)
library(plotly)
plot_ly(type = 'scatter', x = mtcars$hp, y = mtcars$mpg,text =paste("Make:",rownames(mtcars),"<br>cyl:",mtcars$cyl,"<br>disp:",                                         mtcars$disp,"<br>qsec:",mtcars$qsec),hoeverinfo = 'text', color= as.factor(mtcars$cyl),mode = "markers")