add.edge.dynamic {dynamicnetwork} | R Documentation |
Adds and edge to the network that is only 'active' during the specified time interval.
add.edge.dynamic(x, time, tail, head, names.eval = NULL, vals.eval = NULL, edge.check = FALSE)
x |
x a dynamicnetwork to which the edge should be added |
time |
time the time (interval [start,end]) describing the edge's existance |
tail |
tail indicies of verticies in the tailset for the edge |
head |
head indicies of verticies in the headset for the edge |
names.eval |
names.eval list of names for edge attributes |
vals.eval |
vals.eval list of values for edge attributes |
edge.check |
edge.check sanity check? |
Edge are added using the normal add.edge internal call, but the time values c(start,end) are stored on an Edge Time List that has entries in the same order as the mel list. see dynamicnetwork
returns the network with the newly added edge.
THE EDGE TIME LIST IS NOT BACKENDED IN C LIKE THE OTHER COMPONENTS! This means that you have to be really carful about assingments, copying, etc.
CURRENT IMPLEMENTED ONLY FOR NON-RENEWAL NETS
section{Warning }{THE EDGE TIME LIST IS NOT BACKENDED IN C LIKE THE OTHER COMPONENTS! This means that you have to be really carful about assingments, copying, etc. }
Skye Bender-deMoll skyebend@skyeome.net, CSDE statnet team
~put references to the literature/web site here ~
see add.edge
in network package, dynamicnetwork
dyn <- as.dynamic(network.initialize(10)); #make a dynamic network dyn<-add.edge.dynamic(dyn,c(1,10),1,2); #slowly and painfully add edges dyn<-add.edge.dynamic(dyn,c(2,10),2,3); dyn<-add.edge.dynamic(dyn,c(3,10),3,4); dyn<-add.edge.dynamic(dyn,c(4,10),4,5); dyn<-add.edge.dynamic(dyn,c(5,10),5,6); dyn<-add.edge.dynamic(dyn,c(6,10),6,7); dyn<-add.edge.dynamic(dyn,c(6,10),7,8); dyn<-add.edge.dynamic(dyn,c(7,10),8,9); dyn<-add.edge.dynamic(dyn,c(8,10),9,1); dyn<-add.edge.dynamic(dyn,c(9,10),10,1); dyn<-add.edge.dynamic(dyn,c(9,20),10,1); dyn<-add.edge.dynamic(dyn,c(9,20),10,5); dyn<-add.edge.dynamic(dyn,c(9,20),10,3); dyn<-add.edge.dynamic(dyn,c(9,20),10,8); #now add some atttributes dyn <- set.dynamic.vertex.attribute(dyn, "color","blue",valid.time=8,v=10) dyn <- set.dynamic.vertex.attribute(dyn, "color","green",valid.time=9,v=10) dyn <- set.dynamic.vertex.attribute(dyn, "color","blue",valid.time=10,v=10) #plot some of the networks par(mfrow=c(3,3)); for(p in 5:13){ slice <-get.slice.network(dyn,p); plot(slice,vertex.col=get.vertex.attribute(slice,"color"),vertex.cex=5, main=p); }