applynetworkfunction: Applies a function (typically a descriptive statistic) to...

View source: R/applynetworkfunction.R

applynetworkfunctionR Documentation

Applies a function (typically a descriptive statistic) to multiple time-aggregated networks

Description

-

Usage

applynetworkfunction(slices, fun)

Arguments

slices

A list of time-aggregated networks, of class igraph

fun

The function to be applied; takes a single argument

Value

A list whose entries represent the function's value for each network

Author(s)

Benjamin Blonder bblonder@email.arizona.edu.

See Also

generatenetworkslices,

Examples

data(ants)
allindivs <- c(union(ants$VertexFrom, ants$VertexTo), "NULL1", "NULL2")
g <- generatetonetwork(ants, allindivs)
td100 <- generatetimedeltas(0,1500,100)
ns100 <- generatenetworkslices(g, td100)
md100 <- applynetworkfunction(ns100, diameter)
tl100 <- generatetimelags(0,1500,100)
nl100 <- generatenetworkslices(g, tl100)
ml100 <- applynetworkfunction(nl100, function(x){diameter(x)})
par(mfrow=c(1,2))
plot(midpoints(td100),unlist(md100),type="l",xlab="Time (window size = 100)",ylab="Diameter")
plot(maxpoints(tl100),unlist(ml100),type="l",xlab="Aggregation time",ylab="Diameter")

timeordered documentation built on Aug. 21, 2023, 1:06 a.m.