plotly

suman

September 25, 2017

library(plotly)
## Warning: package 'plotly' was built under R version 3.4.1
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 3.4.1
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
suppressPackageStartupMessages(library(plotly))
##
plot_ly(data = mtcars, x = ~wt, y = ~mpg, 
        color = ~as.factor(cyl), size = ~hp,
        text = ~paste("Weight: ", wt, '<br>MPG:', mpg),
        type = "scatter", mode = "markers") %>%
  layout(title = "Car Data")