I am creating an animation of a changing social network in R package NDTV. I have a list of vertices I would like to have grouped together during a short period of the animation. What is the best way to do this?
I've pursued three different avenues, but failed in all of them. Any suggestions would be appreciated.
1) I've tried using a vertex attribute called "group", on the understanding that this will enable me to associate a vertex with a group. Using the 'wheel' animation in ndtv workshop as my starting point, I've attempted to deploy the following code:
activate.vertex.attribute(wheel,'group','2',onset=6,terminus=8,v=1)
render.animation(wheel,vertex.group='group',verbose=FALSE)
But this brings up the error message: "group is not a graphical parameter."
This is puzzling because when I run list.vertex.attributes(wheel)
, group.active
is listed as an attribute. Color.active
also is listed as an attribute, and I am able to change the color of vertices using the method described above. Why is one attribute recognized by the program while the other is not?
2) I've also tried uploading a csv file comprised of x coordinates and y coordinates, in the hopes that I can use this to dictate the position of the vertices. I was able to upload the csv file and create a static plot with the new coordinates, but I wasn't able to incorporate the new coordinates into the changing animation of that plot. Here's the data and code I used (again, this code was deployed after initializing the network as described in the ndtv workshop)
df<-read.csv(file="coords.csv",header=F,sep=",")
plot(wheelAt8,coords=df)
This results in a static graph that reflects the uploaded coordinates, but the animation itself is not changed.
3) Because I couldn't get the above to work, I am now trying to modify network.layout.animate.useAttribute(net, dist.mat = NULL, default.dist = NULL,seed.coords = NULL, layout.par = list(x = "x", y = "y"), verbose = TRUE)
for this project.
I'm not sure where to start because I am not sure how to put coordinate values into "x".
Thank you for your time.