Suppose I have the following data frames :
a <- c(1,2,2,3,7,9,8,3,7,9)
b <- c(1:10)
df1 <- data.frame(a,b)
c <- c(2,5,4)
d <- c(3,6,5)
df2 <- data.frame(c,d)
And I generate a scatter plot of df1 with plotly :
p <- plot_ly(data=df1, x=a, y=b)
Then how can I add points from df2 to p with, for instance, a different color?