library(plotly)
# this works nicely
plot_ly(iris, x = ~Sepal.Length, y = ~Sepal.Width, color = ~factor(Species), size = ~Petal.Length)
# this doesn't
myiris <- iris[!duplicated(iris$Species), ]
plot_ly(myiris, x = ~Sepal.Length, y = ~Sepal.Width, color = ~factor(Species), size = ~Petal.Length)