Learn R Programming

timeordered (version 1.0.1)

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, normalizebyname=FALSE)

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.

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.

normalizebyname

If true, divides the number of vertices reached by the number of unique vertex names; if false, by the number of time-ordered vertices.

Author

Benjamin Blonder bblonder@email.arizona.edu.

See Also

transformspreadbyindividual

Examples

Run this code
data(ants)
allindivs <- c(union(as.character(ants$VertexFrom), as.character(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