File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,13 @@ contact_data <- socialmixr::contact_matrix(
2929
3030contact_data
3131
32+ # Matrix are symmetric for the total number of contacts
33+ # of one group with another is the same as the reverse
34+ contact_data $ matrix * contact_data $ demography $ proportion
35+
3236# Prepare contact matrix
37+ # {socialmixr} provides contacts from-to
38+ # {epidemics} expects contacts to-from
3339socialcontact_matrix <- t(contact_data $ matrix )
3440
3541socialcontact_matrix
Original file line number Diff line number Diff line change @@ -47,7 +47,13 @@ contact_data <- socialmixr::contact_matrix(
4747
4848contact_data
4949
50+ # Matrix are symmetric for the total number of contacts
51+ # of one group with another is the same as the reverse
52+ contact_data $ matrix * contact_data $ demography $ proportion
53+
5054# Prepare contact matrix
55+ # {socialmixr} provides contacts from-to
56+ # {epidemics} expects contacts to-from
5157socialcontact_matrix <- t(contact_data $ matrix )
5258
5359socialcontact_matrix
You can’t perform that action at this time.
0 commit comments