data(mtcars)
mtcars$cyl <- as.factor(mtcars$cyl)
plot_ly(mtcars,x = ~wt, y = ~mpg, color = ~cyl)
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plot.ly/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plot.ly/r/reference/#scatter-mode