Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

duration.matrix

Construct a edge spells list from base network and toggle list.


Description

Given a network object and a toggle list, it will construct a list of edges and activity spells and return that as a data frame. The network object does not need to have edges; it only needs to have enough vertices to cover all the edges specified in the toggle list.

The toggle list should be a three column matrix or data frame, where the first column is the toggle time, the second column is the tail vertex id of the edge, and the third column is the head vertex id of the edge. A toggle represents a switch from active state to inactive, or vice-versa.

Usage

duration.matrix(nw0, changes, start, end)

Arguments

nw0

an object of class network

changes

a matrix or data frame, listing the toggles for edges as specified in the above description

start

integer, specifies the starting time of the network's dynamic activity

end

integer, specifies the ending time of the network's dynamic activity

Value

Returns a data frame that lists the edge spells specified by the toggles. The columns in the data frame are start end tail head left.censored right.censored duration. Left and right censoring and duration are calculated automatically from the toggle list and the start and end times.

Author(s)

Ayn Leslie-Cook aynlc3@uw.edu, Carter T. Butts buttsc@uci.edu

See Also

Examples

library(networkDynamic)
  # duration matrix test
  net <-network.initialize(3)
  net[1,2]<-1;
  net[2,3]<-1;
  net[1,3]<-1;
  class(net)
  # toggle list: time, tail, head
  tog=matrix(c(1,1,2, 1,2,3, 2,1,2, 4,1,3, 4,1,2), ncol=3, byrow=TRUE)
  networkDynamic:::duration.matrix(net, tog, 0, 5)

networkDynamic

Dynamic Extensions for Network Objects

v0.10.1
GPL-3
Authors
Carter T. Butts [aut], Ayn Leslie-Cook [aut], Pavel N. Krivitsky [aut], Skye Bender-deMoll [aut, cre], Zack Almquist [ctb], David R. Hunter [ctb], Li Wang [ctb], Kirk Li [ctb], Steven M. Goodreau [ctb], Jeffrey Horner [ctb], Martina Morris [ctb]
Initial release
2020-01-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.