View source: R/applynetworkfunction.R
applynetworkfunction | R Documentation |
-
applynetworkfunction(slices, fun)
slices |
A list of time-aggregated networks, of class igraph |
fun |
The function to be applied; takes a single argument |
A list whose entries represent the function's value for each network
Benjamin Blonder bblonder@email.arizona.edu.
generatenetworkslices
,
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.