Skip to contents

Constructor for a contactmatrix_list object

Usage

new_contactmatrix_list(...)

Arguments

...

contactmatrix objects to include in the list. All elements must have the same groupings.

Value

A list of contactmatrix objects, of class contactmatrix_list.

Examples

cm1 <- new_contactmatrix(
  from  = c("[0,5)", "[5,10)",  "[5,10)"),
  to    = c("[0,5)", "[10,15)", "[15,20)"),
  value = c(0.32   , 0.46   , 0.72   )
)

cm2 <- new_contactmatrix(
  from  = c("[5,10)",  "[0,5)",   "[5,10)"),
  to    = c("[15,20)", "[10,15)", "[10,15)"),
  value = c(0.27   , 0.09   , 0.32   )
)

cml <- new_contactmatrix_list(cm1, cm2)