Skip to content

Commit b2c87c5

Browse files
committed
sync with brief explanation
1 parent 9001a54 commit b2c87c5

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

instructors/data/04-practical-activity-1.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ contact_data <- socialmixr::contact_matrix(
2929

3030
contact_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
3339
socialcontact_matrix <- t(contact_data$matrix)
3440

3541
socialcontact_matrix

instructors/fig/04-practical-instructor-1.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ contact_data <- socialmixr::contact_matrix(
4747

4848
contact_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
5157
socialcontact_matrix <- t(contact_data$matrix)
5258

5359
socialcontact_matrix

0 commit comments

Comments
 (0)