reconcile.activity | R Documentation |
When networkDynamic objects are created from real-world data it is often the case that activity information for vertices and edges may not come from the same source and may not match up exactly. Vertices may be inactive when incident edges are active, etc. The reconcile.vertex.activity
function modifies the activity of a network's vertices acording to the mode
specified, while reconcile.edge.activity
performs similar operations for edges.
reconcile.vertex.activity(net,
mode = c ("expand.to.edges", "match.to.edges", "encompass.edges"),
edge.active.default = TRUE)
reconcile.edge.activity(net,
mode = c("match.to.vertices", "reduce.to.vertices"),
active.default = TRUE)
net |
a |
mode |
string indicating the method for reconciling |
edge.active.default |
boolean, should edges with no definied activity be considered active? |
active.default |
boolean, should vertices with no definied activity be considered active? |
The mode
argument takes the following values:
match.to.edges
vertices will be modified so as to be only active when incident edges are active. Existing vertex spells are deleted.
expand.to.edges
vertices activity will be expanded to include the activity periods of any incident edges (still permits isolated vertices). Existing vertex spells are preserved.
encompass.edges
vertices activity will be modified so that it has a single spell beginning with the earliest incident edge activity, and encompasses the last edge activity. (Note that this implies that isolated vertices will become inactive).
match.to.vertices
edges will be modified so as to be active whenever all incident vertices are active. Existing inactive edges will be activated if necessary.
reduce.to.vertices
edges will be modified so as to have no active spells when incident vertices are inactive. Inactive edges will not be activated.
The input networkDynamic
object is modified in place and returned invisibly.
skyebend, lxwang
nd<-network.initialize(6)
add.edges.active(nd,tail=1:3,head=2:4,onset=1,terminus=3)
add.edges.active(nd,tail=4,head=1,onset=5,terminus=7)
add.edge(nd,tail=1,head=6)
# before
get.vertex.activity(nd,as.spellList=TRUE)
reconcile.vertex.activity(nd)
# after
get.vertex.activity(nd,as.spellList=TRUE)
# induce edge activity for known vertex timing
nd<-network.initialize(4,directed=FALSE)
activate.vertices(nd,onset=1:4,terminus=3:6)
nd[,]<-1
get.edge.activity(nd,as.spellList=TRUE)
reconcile.edge.activity(nd, mode="reduce.to.vertices")
get.edge.activity(nd,as.spellList=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.