Learn R Programming

EpiModel (version 2.2.1)

record_attr_history: Record Attributes History

Description

This function records values specific to a time-step and a group of nodes. The nodes are identified by their unique_ids which allows the recording of data for nodes that are no longer in the network by the end of the run. The records are stored in dat[["attr.history"]] and can be accessed from the netsim object with get_attr_history

Usage

record_attr_history(dat, at, attribute, posit_ids, values)

Value

The Master list object

See the "Time Varying Attributes" vignette

Arguments

dat

a Master list object of network models

at

the time where the recording happens

attribute

the name of the value to record

posit_ids

a numeric vector of posit_ids to which the measure applies. (see get_posit_ids)

values

the values to be recorded

Examples

Run this code
if (FALSE) {

dat <- record_attr_history(dat, at, "attr_1", get_posit_ids(dat), 5)
some_nodes <- get_posit_ids(dat)
some_nodes <- some_nodes[runif(length(some_nodes)) < 0.2]
dat <- record_attr_history(
  dat, at,
  "attr_2",
  some_nodes,
  rnorm(length(some_nodes))
)

}

Run the code above in your browser using DataLab