@@ -86,23 +86,16 @@ The R package `{socialmixr}` contains functions which can estimate contact matri
8686polymod <- socialmixr :: polymod
8787```
8888
89- Then we can obtain the contact matrix for the age categories we want by specifying ` age.limits ` .
89+ Then we can obtain the contact matrix for the age categories we want by specifying ` age_limits ` .
9090
9191
9292``` r
9393contact_data <- socialmixr :: contact_matrix(
9494 survey = polymod ,
9595 countries = " United Kingdom" ,
96- age.limits = c(0 , 20 , 40 ),
96+ age_limits = c(0 , 20 , 40 ),
9797 symmetric = TRUE
9898)
99- ```
100-
101- ``` output
102- Removing participants that have contacts without age information. To change this behaviour, set the 'missing.contact.age' option
103- ```
104-
105- ``` r
10699contact_data
107100```
108101
@@ -221,17 +214,16 @@ Similar to the code above, to access vector values within a dataframe, you can u
221214contact_data_zambia <- socialmixr :: contact_matrix(
222215 survey = zambia_sa_survey ,
223216 countries = " Zambia" , # key argument
224- age.limits = c(0 , 20 ),
217+ age_limits = c(0 , 20 ),
225218 symmetric = TRUE
226219)
227220```
228221
229- ``` output
230- Removing participants without age information. To change this behaviour, set the 'missing.participant.age' option
231- ```
232-
233- ``` output
234- Removing participants that have contacts without age information. To change this behaviour, set the 'missing.contact.age' option
222+ ``` warning
223+ Warning: Survey contains multiple observations per participant (4531 rows, 3576 unique
224+ participants).
225+ • Results will aggregate across all observations.
226+ ℹ Use `filter` to select by "Building_id".
235227```
236228
237229``` r
@@ -243,8 +235,8 @@ contact_data_zambia
243235$matrix
244236 contact.age.group
245237age.group [0,20) 20+
246- [0,20) 3.650000 1.451168
247- 20+ 1.988136 2.461856
238+ [0,20) 3.766393 1.427100
239+ 20+ 1.955162 2.642584
248240
249241$demography
250242 age.group population proportion year
@@ -255,8 +247,8 @@ $demography
255247$participants
256248 age.group participants proportion
257249 <char> <int> <num>
258- 1: [0,20) 180 0.08490566
259- 2: 20+ 1940 0.91509434
250+ 1: [0,20) 244 0.08531469
251+ 2: 20+ 2616 0.91468531
260252```
261253
262254``` r
@@ -373,7 +365,7 @@ Normalisation can be performed by the function `contact_matrix()` in `{socialmix
373365contact_data_split <- socialmixr :: contact_matrix(
374366 survey = polymod ,
375367 countries = " United Kingdom" ,
376- age.limits = c(0 , 20 , 40 ),
368+ age_limits = c(0 , 20 , 40 ),
377369 symmetric = TRUE ,
378370 split = TRUE
379371)
0 commit comments