I'd like to make a simple gif with 138 states. I don't need any fancy transitions between each state, but I do need every state to appear in my gif. Currently, gganimate is cutting my gif short, not revealing the last ~30ish states.
Example
df <- lapply(1:138, function(t){
data.frame(
DT = as.POSIXct("2019-01-01 12:00:00", tz = "UTC") + t*24*60*60,
x = seq(-3, 3, length.out = 100),
y = t * seq(-3, 3, length.out = 100)
)
})
df <- do.call(rbind, df)
range(df$DT) # "2019-01-02 12:00:00 UTC" "2019-05-19 12:00:00 UTC"
p <- ggplot(data = df, mapping = aes(x = x, y = y)) +
geom_point()+
transition_states(states = DT, transition_length = 0, state_length = 1)+
labs(title = 'ScrapeDT: {previous_state}')
p
As you can see, the gif plays until about 2019-04-10, instead of 2019-05-19. I've also tried tinkering with animate() with no success. For example,
animate(
plot = p,
nframes = length(unique(df$DT)),
fps = 8,
end_pause = 8
)
How can I make this work so that every desired state is shown for say, 0.25 seconds?



