library(ggplot2) p <- ggplot(iris) + aes(x = Petal.Width, y = Sepal.Length, color = Species) + geom_point() library(plotly) ggplotly(p)