I recall seeing an animation of schooling fish somewhere a while back a long time ago and it could be interesting to recreate with R and gganimate as a tutorial touching on gganimate and perhaps on a workflow using both matrices / arrays and tibbles.
Anyway, if you have a bunch of "fish" (points (x1, y1), (x2, y2), ..., (xn, yn)), IIRC you can simulate schooling behavior by moving each fish toward the center of the school, but adding some random noise so they don't go exactly in the direction of the center.
I'm fairly sure this is right. Part of the adventure would be that it could be totally wrong.
I recall seeing an animation of schooling fish somewhere a while back a long time ago and it could be interesting to recreate with R and
gganimate
as a tutorial touching ongganimate
and perhaps on a workflow using both matrices / arrays and tibbles.Anyway, if you have a bunch of "fish" (points (
x1
,y1
), (x2
,y2
), ..., (xn
,yn
)), IIRC you can simulate schooling behavior by moving each fish toward the center of the school, but adding some random noise so they don't go exactly in the direction of the center.I'm fairly sure this is right. Part of the adventure would be that it could be totally wrong.