select_matrix-set: Set the select matrix for a 'SimInf_model' object

select_matrix<-R Documentation

Set the select matrix for a SimInf_model object

Description

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

Usage

select_matrix(model) <- value

## S4 replacement method for signature 'SimInf_model'
select_matrix(model) <- value

Arguments

model

The model to set the select matrix for.

value

A matrix.

Examples

## 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 select matrix
select_matrix(model) <- matrix(c(1, 0, 0, 1, 1, 1, 0, 0, 1), nrow = 3)

## Extract the select matrix from the model
select_matrix(model)

SimInf documentation built on Jan. 23, 2023, 5:43 p.m.