Tweenr/gganimate with line plot

That would only put one observation in each data frame, so it just moves a point between them without drawing a line (as with one observation, there aren't two points between which to draw a line):

tweenr2

It could be a useful approach for tracing a line or animating particles, but doesn't give a sense of the full line.

You could add cumulative = TRUE back, which adds the line back, but unfortunately also a lot of intermediate points:

tweenr3

If this is a relatively frequent approach, it wouldn't be that hard to wrap the splitting and tweening into a function. If well-abstracted and presented with a solid case for its existence, it could even make a nice PR.

1 Like