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

View source: R/spreadanalysis.R

spreadanalysisR Documentation

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)

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.

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.

Note

Results can be aggregated by start vertex - see transformspreadbyindividual

Author(s)

Benjamin Blonder bblonder@email.arizona.edu.

See Also

transformspreadbyindividual

Examples

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")


bblonder/timeordered documentation built on Aug. 29, 2023, 9:15 a.m.