Skip to content

Commit e93584f

Browse files
committed
rename social contact matrix object to avoid overlap with function
1 parent b11a254 commit e93584f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

episodes/simulating-transmission.Rmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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

217217
Remember 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)
288288
initial_conditions
289289
```
290290

@@ -299,7 +299,7 @@ The population object requires a vector containing the demographic structure of
299299
demography_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)
303303
demography_vector
304304
```
305305

@@ -310,7 +310,7 @@ library(epidemics)
310310
311311
uk_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
)

0 commit comments

Comments
 (0)