I have a dataframe where each row contains information about the coordinates of 8 points at a point in time:
Time x1 y1 x2 y2 x3 y3 … x8 y8
A row may look like this for example:
myData <- data.frame(time=0.1,x1=-7.79,y1=7.32,x2=-3.86,y2=-1.62,x3=-1.35,y3=-4.61,x4=-6.24,y4=-9.89,x5=-6.40,y5=2.00,x6=4.02,y6=4.77,x7=-1.42,y7=9.89,x8=6.59,y8=-8.02)
The problem I have is that ggplot only accepts 1 column name for each axis. Moreover, I would like to animate the movements of the points using gganimate, that's why I want to use ggplot. How can I do this?
I managed to animate the data by drawing a plot using the standard R plot() method for each point in time and redrawing it, but that doesn't allow me to save the animation or work with it further.