I am using the R programming language. I found some examples on the plotly r website that I am trying to replicate: https://plotly.com/r/cumulative-animations/ and https://p