I would like to create an animated histogram in R using plotly sliders. A segment of each row in the dataframe should equate to a single frame of the animation. I assumed this would be possible by using the 'frame' argument. However, it seems that the histogram plot is unable to accept dataframes as an input:
fig <-plot_ly(x=d[,first_resistance_column:last_resistance_coluimn],type="histogram",frame=~d[disp_col])
I would need to use unlist to actually get a histogram plot to show up, at which point I can't use the frame argument because the input data is no longer a dataframe:
fig <-plot_ly(x=unlist(d[,first_resistance_column:last_resistance_coluimn]),type="histogram",frame=~d[disp_col])
Does anyone know how I can accomplish this? It seems like this is not possible with the way that plotly histograms work in R.