How to add constant line to animated plot in plotly
up vote
1
down vote
favorite
I am using plotly package in R and need to make an animated plot which combines data from my dataset with constant tresholds that are not connected to data in the dataset. The code works fine without frame (the plot is not animated in this case). If I add the line frame = g I get the following error: Column frame must be length 1 or 10000, not 3 The plot also works fine with frame but without the 'add_lines' part. How can I get rid of the error and have the constant line in every frame? The code is the following: library(plotly) a <- c(0.006, 0.008, 0.10) b <- c(0.20, 0.15, 0.22) g <- c('first', 'second', 'third') p <- plot_ly( x = a, y = b, frame = g, type = 'scatter', mode = 'markers' ) %>% add_line