Learn R Programming

timeordered (version 1.0.1)

transformspreadbyindividual: A helper function to assess differences in spreading potential by vertex.

Description

Converts a data frame of spreading samples into a data frame that is grouped by vertex identity.

Usage

transformspreadbyindividual(sa)

Value

A data frame whose columns are the identities of vertices and whose rows are the mean fraction of vertices reached by the seed vertex at each time delay, averaged over all samples beginning at this vertex.

Arguments

sa

A data frame returned by spreadanalysis

Author

Benjamin Blonder bblonder@email.arizona.edu.

See Also

spreadanalysis

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)
b <- transformspreadbyindividual(sa)
plot(ts(b),plot.type="single",col=rainbow(ncol(b)),xlab="Time",ylab="Fraction reached")
legend("bottomright",colnames(b),lwd=1,col=rainbow(ncol(b)),bg="white")

Run the code above in your browser using DataLab