I can get the following to work if g is a factor variable but I would like colors treated continuously. When I run the following, the color is ignored - line segments are all blue.
require(plotly)
x <- rep(c(1, 1, NA, 2, 2, NA, 3, 3, NA), 2)
y <- c(1, 2, NA, 2, 3, NA, 3, 4, NA, 11, 12, NA, 12, 13, NA, 13, 14, NA)
g <- c(rep(1, 9), rep(2, 9))
plot_ly(x=x, y=y, type='lines', color=g)
