transformspreadbyindividual: A helper function to assess differences in spreading...

View source: R/transformspreadbyindividual.R

transformspreadbyindividualR Documentation

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)

Arguments

sa

A data frame returned by spreadanalysis

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.

Author(s)

Benjamin Blonder bblonder@email.arizona.edu.

See Also

spreadanalysis

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


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