File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,10 +208,10 @@ contact_data <- socialmixr::contact_matrix(
208208)
209209
210210# prepare contact matrix
211- contact_matrix <- t(contact_data$matrix)
211+ socialcontact_matrix <- t(contact_data$matrix)
212212
213213# print
214- contact_matrix
214+ socialcontact_matrix
215215```
216216
217217Remember that the matrix satisfies the ` symmetric = TRUE ` condition at the level of total number of contacts.
@@ -284,7 +284,7 @@ initial_conditions <- rbind(
284284)
285285
286286# use contact matrix to assign age group names
287- rownames(initial_conditions) <- rownames(contact_matrix )
287+ rownames(initial_conditions) <- rownames(socialcontact_matrix )
288288initial_conditions
289289```
290290
@@ -299,7 +299,7 @@ The population object requires a vector containing the demographic structure of
299299demography_vector <- contact_data$demography$population
300300
301301# use contact matrix to assign age group names
302- names(demography_vector) <- rownames(contact_matrix )
302+ names(demography_vector) <- rownames(socialcontact_matrix )
303303demography_vector
304304```
305305
@@ -310,7 +310,7 @@ library(epidemics)
310310
311311uk_population <- epidemics::population(
312312 name = "UK",
313- contact_matrix = contact_matrix ,
313+ contact_matrix = socialcontact_matrix ,
314314 demography_vector = demography_vector,
315315 initial_conditions = initial_conditions
316316)
You can’t perform that action at this time.
0 commit comments