1

I have a data set in csv format. I wanted to create a network object and make an animation out of this data set. I wrote a sample code in R to perform this operation.

What i want to is to highlight certain nodes (4,7) in the animation and add legends in the animation mentioning (4,7) the importance of those nodes. Any suggestions to solve this will be appreciated. The dataset is attached ::: raw_data

#Removing the saved list
rm(list = ls(all.names = T))
#loading libraries
library(networkDynamic)
#loading data
raw_data <- read.csv("arranged_data1.csv",header = TRUE) 
timeData<-read.csv("arranged_data1.csv",header = TRUE)
#arranging data--------------------"onset"---beginning time of interaction:::"terminus"-----end of interaction
timeData$onset <- timeData$onset
timeData$terminus <- timeData$terminus
#finding the unique ant ids---------------"tail"--from where the interaction begins:::"head"--to where is the interaction
unique_ant_ids<-unique(c(timeData$tail,timeData$head))
#covert ids
timeData$head<- match(timeData$head,unique_ant_ids)
timeData$tail<- match(timeData$tail,unique_ant_ids)
#converting to network dynamic object
network_obj<-networkDynamic(edge.spells=timeData)
library(ndtv)
compute.animation(network_obj)
saveVideo(render.animation(enronDyn))
CJ Yetman
  • 8,373
  • 2
  • 24
  • 56
  • You can use the visNetwork package as this will allow you to click on nodes and highlight specific ones –  Nov 20 '19 at 10:00
  • I don't want to click and highlight nodes. I would like to specify the nodes prior and save it as a video – Bhaskara Patelar Nov 20 '19 at 10:23

0 Answers0