We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ee4307 commit 883ec37Copy full SHA for 883ec37
instructors/fig/04-challenge-instructor.R
@@ -0,0 +1,23 @@
1
+library(socialmixr)
2
+
3
+# Access the contact survey data from Zenodo
4
+zambia_sa_survey <- socialmixr::get_survey(
5
+ "https://doi.org/10.5281/zenodo.3874675"
6
+)
7
8
+# Inspect the countries within the survey object
9
+levels(zambia_sa_survey$participants$country)
10
11
+# Generate the contact matrix for Zambia only
12
+contact_data_zambia <- socialmixr::contact_matrix(
13
+ survey = zambia_sa_survey,
14
+ countries = "Zambia", # key argument
15
+ age.limits = c(0, 20),
16
+ symmetric = TRUE
17
18
19
+# Print the contact matrix for Zambia only
20
+contact_data_zambia
21
22
+# Print the vector of population size for {epidemics}
23
+contact_data_zambia$demography$population
0 commit comments