epiforecasts / socialmixr

R package for deriving social mixing matrices from survey data.
http://epiforecasts.io/socialmixr/
Other
38 stars 11 forks source link

Split up `contact_matrix` function #131

Open sbfnk opened 2 months ago

sbfnk commented 2 months ago

It's too long and hard to parse - atomised bits should be split off into separate functions.

sbfnk commented 4 days ago

One thing that could/should be done as part of this is to move some of the data (pre-)processing into other functions.

E.g. it would be better along the lines of:

polymod |>
  split_age_into_groups(c(0, 5, 10, 15) |>
  sample_missing("age.group") |>
  contact_matrix()

rather than doing this inside contact_matrix()