Learn R Programming

timeordered (version 0.9.6)

spreadanalysis: Simulates the perfect spread of a resource on a time-ordered network.

Description

Determines the number of unique vertices that can be causally linked to an interaction event after a certain time delay. This function determines the fraction of unique vertices reached after a certain time from a random sample of interaction events.

Usage

spreadanalysis(g, timedelays, numsamples)

Arguments

g
The time-ordered network to be studied.
timedelays
A vector time delays at which to determine the fraction of vertices reached.
numsamples
The number of random events to sample (without replacement) as seeds for the spreading process.

Value

  • A data frame whose columns are named for each time delay and contains the fraction of total vertices reached by a spreading process beginning from the seed vertices by the time delay.

See Also

transformspreadbyindividual

Examples

Run this code
data(ants)
allindivs <- c(union(ants$VertexFrom, ants$VertexTo), "NULL1", "NULL2")
g <- generatetonetwork(ants, allindivs)
sa <- spreadanalysis(g, seq(0,1000,by=50), 20)
boxplot(sa[,-1],xlab="Time delay",ylab="Fraction reached")

Run the code above in your browser using DataLab