Skip to content

Commit 883ec37

Browse files
committed
add instructor info section four
1 parent 0ee4307 commit 883ec37

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)