Learn R Programming

timeordered (version 1.0.1)

generatetonetwork: Generates a time-ordered network from an interaction list.

Description

Constructs a directed network describing the causally permitted paths between a set of vertices that interact at known times.

Usage

generatetonetwork(raw, allindivs)

Value

A weighted directed network of class 'igraph'. Each vertex represents an individual at a time during which an interaction occurred. Edges represent causally permitted paths of resource flow and have a TimeCost, describing the time between interactions for an individual, or is 0 if the edge represents an interaction, and a HopCost, which is 0 if the edge connects the same individual at multiple times and 1 if it connects different individuals at the same time.

Arguments

raw

An event list, consisting of a data frame with four columns: VertexFrom, VertexTo, TimeStart, and TimeStop. Each row in this data frame represents a single directed interaction event between VertexFrom and VertexTo beginning at TimeStart and ending at TimeStop.

allindivs

A list of all possible vertices potentially including ones not observed interacting during the range of time reported in raw. Defaults to the vertices observed in raw.

Author

Benjamin Blonder bblonder@email.arizona.edu.

References

Kostakos V. Temporal Graphs. arXiv (2008) vol. physics.soc-ph

Examples

Run this code
data(ants)
allindivs <- c(union(as.character(ants$VertexFrom), as.character(ants$VertexTo)), "NULL1", "NULL2")
g <- generatetonetwork(ants, allindivs)
plottonet(g)

Run the code above in your browser using DataLab