# NOT RUN {
data(moodyContactSim)
# use slices at each changing time point
library(networkDynamicData)
data(vanDeBunt_students)
times<-get.change.times(vanDeBunt_students)
vanDProj<-timeProjectedNetwork(vanDeBunt_students,onsets = times,termini = times)
# plot it with gray for the time edges
plot(vanDProj,
arrowhead.cex = 0,
edge.col=ifelse(vanDProj%e%'edge.type'=='within_slice','black','gray'),
vertex.cex=0.7,mode='kamadakawai')
# }
# NOT RUN {
# compute shortest temporal path distances from each vertex in first slice
# to each vertex in last slice
library(sna)
geodist(vanDProj)$gdist[1:32,193:224]
# bin the moody sim into 100 timestep chunks
# (this will over-represent some transmission potential)
moodyProj<-timeProjectedNetwork(moodyContactSim,time.increment=100)
plot(moodyProj,arrowhead.cex = 0,
edge.col=ifelse(moodyProj%e%'edge.type'=='within_slice','black','gray'),
vertex.cex=0.7,displaylabels = TRUE,label.cex=0.6)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab