Skip to content

Commit 5c05379

Browse files
avallecamclaude
andcommitted
rename zambia survey objects to survey_files_zambia and survey_load_zambia
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2499626 commit 5c05379

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

episodes/contact-matrices.Rmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ The example above uses the POLYMOD survey. A number of surveys are available in
136136

137137
```{r, message = FALSE, warning = FALSE}
138138
# Download and load the contact survey data for Zambia from Zenodo
139-
zambia_survey_files <- contactsurveys::download_survey(
139+
survey_files_zambia <- contactsurveys::download_survey(
140140
survey = "https://doi.org/10.5281/zenodo.3874675",
141141
verbose = FALSE
142142
)
143143
144-
zambia_sa_survey <- socialmixr::load_survey(files = zambia_survey_files)
144+
survey_load_zambia <- socialmixr::load_survey(files = survey_files_zambia)
145145
```
146146

147147
:::::::::::::::::: spoiler
@@ -177,11 +177,11 @@ The R package {socialmixr} contains functions which can estimate contact matrice
177177

178178
::::::::::::::::::::: hint
179179

180-
The survey object `zambia_sa_survey` contains data from two countries. If you need to estimate the social contact matrix from data of the specific country of Zambia, identify what argument in `socialmixr::contact_matrix()` you need for this.
180+
The survey object `survey_load_zambia` contains data from two countries. If you need to estimate the social contact matrix from data of the specific country of Zambia, identify what argument in `socialmixr::contact_matrix()` you need for this.
181181

182182
```{r}
183183
# Inspect the countries within the survey object
184-
levels(zambia_sa_survey$participants$country)
184+
levels(survey_load_zambia$participants$country)
185185
```
186186

187187
Similar to the code above, to access vector values within a dataframe, you can use the dollar-sign operator: `$`
@@ -195,7 +195,7 @@ Similar to the code above, to access vector values within a dataframe, you can u
195195
```{r zambia_solution}
196196
# Generate the contact matrix for Zambia only
197197
contacts_byage_zambia <- socialmixr::contact_matrix(
198-
survey = zambia_sa_survey,
198+
survey = survey_load_zambia,
199199
countries = "Zambia", # key argument
200200
age_limits = c(0, 20),
201201
symmetric = TRUE,

0 commit comments

Comments
 (0)