Learn R Programming

SimInf (version 11.1.0)

ldata: Extract local data from a node

Description

The local data is a numeric vector that is specific to a node. The local data vector is passed as an argument to the transition rate functions and the post time step function.

Usage

ldata(model, node)

# S4 method for SimInf_model ldata(model, node)

Value

a numeric vector

Arguments

model

The model to get local data from.

node

index to node to extract local data from.

See Also

gdata for retrieving global data (common to all nodes), and SimInf_model for the class definition and overview of model structure.

Examples

Run this code
## Create an 'SISe' model with 1600 nodes.
model <- SISe(
  u0 = u0_SIS(),
  tspan = 1:100,
  events = events_SIS(),
  phi = 0,
  upsilon = 1.8e-2,
  gamma = 0.1,
  alpha = 1,
  beta_t1 = 1.0e-1,
  beta_t2 = 1.0e-1,
  beta_t3 = 1.25e-1,
  beta_t4 = 1.25e-1,
  end_t1 = c(91, 101),
  end_t2 = c(182, 185),
  end_t3 = c(273, 275),
  end_t4 = c(365, 360),
  epsilon = 0
)

## Display local data from the first two nodes.
ldata(model, node = 1)
ldata(model, node = 2)

Run the code above in your browser using DataLab