library(gapminder) library(plotly)
gapminder %>% plot_ly(x = ~gdpPercap, y = ~lifeExp, type = "scatter", mode = "markers", color = ~continent, frame = ~year)