Learn R Programming

SimInf (version 9.8.1)

shift_matrix<-: Set the shift matrix for a SimInf_model object

Description

Utility function to set events@N in a SimInf_model object, see SimInf_events

Usage

shift_matrix(model) <- value

# S4 method for SimInf_model shift_matrix(model) <- value

Value

SimInf_model object

Arguments

model

The model to set the shift matrix events@N.

value

A matrix.

Examples

Run this code
## Create an SIR model
model <- SIR(u0 = data.frame(S = 99, I = 1, R = 0),
             tspan = 1:5, beta = 0.16, gamma = 0.077)

## Set the shift matrix
shift_matrix(model) <- matrix(c(2, 1, 0), nrow = 3)

## Extract the shift matrix from the model
shift_matrix(model)

Run the code above in your browser using DataLab