library(plotly); library(datasets); data("InsectSprays")
## Loading required package: ggplot2
## 
## 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
plot_ly(InsectSprays, x = ~spray, y = ~count, name = "Insect sprays data", type = "box")