View source: R/net.fn.track.attrs.R
| get_attr_at | R Documentation |
Reconstructs the state of all tracked attributes at a specific time step
from the delta-compressed attribute history. Returns a tibble with one
row per active node and one column per tracked attribute.
get_attr_at(sim, at, sim_num = 1, compute_age = FALSE)
sim |
An |
at |
The time step at which to reconstruct attributes, on the time
step labels of |
sim_num |
The simulation number to use (default 1). |
compute_age |
If |
A tibble with columns unique_id, active, and one column per
tracked attribute, containing the most recent value at or before at
for each active node.
record_attr_history(), get_attr_history()
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)
# The status of every node at time step 10
at10 <- get_attr_at(sim, at = 10)
head(at10)
table(at10$status)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.