get_attr_history: Extract the Attributes History from Network Simulations

View source: R/get.R

get_attr_historyR Documentation

Extract the Attributes History from Network Simulations

Description

Extract the Attributes History from Network Simulations

Usage

get_attr_history(sims)

Arguments

sims

An EpiModel object of class netsim.

Value

A list of data.frames, one for each "measure" recorded in the simulation by the record_attr_history function.

Examples


nw <- network_initialize(n = 100)
est <- netest(nw, formation = ~edges, target.stats = 50,
              coef.diss = dissolution_coefs(~offset(edges), 10),
              verbose = FALSE)
control <- control.net(type = "SI", nsteps = 20, nsims = 1,
                       tracked.attributes = "status", verbose = FALSE)
sim <- netsim(est, param.net(inf.prob = 0.3, act.rate = 1),
              init.net(i.num = 10), control)

# One data frame per tracked attribute, with the changes at each step
hist <- get_attr_history(sim)
names(hist)
head(hist$status)



EpiModel documentation built on Oct. 16, 2026, 5:07 p.m.