Social Mixing Matrices for Infectious Disease Modelling

Provides methods for sampling contact matrices from diary data for use in infectious disease modelling, as discussed in Mossong et al. (2008) .

Build Status codecov

socialmixr is an R package to derive social mixing matrices from survey data.


The current development version can be installed using the devtools package



For information on how to use the socialmixr package, see the vignette.


socialmixr 0.1.3

  • improved handling of DOIs
  • fixed usage of weights
  • more consistency checks and tests
  • performance improvements when weighting
  • 'pop_age' can now be called by the user

socialmixr 0.1.2

  • improved downloading form Zenodo; only a single download is used now
  • improved handling of country names
  • fixed bugs in the "filter" option
  • POLYMOD data set updated to latest v1.1
  • allow user to choose how ages are estimated from age ranges

socialmixr 0.1.1

  • fix: dependency on R >= 3.4.0
  • updated reference handling if a survey is not pulled from Zenodo
  • the 'survey' function can now be used to create a 'survey' object from data frames
  • a few small patches and fixes

socialmixr 0.1.0

  • initial release

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.1.8 by Sebastian Funk, a year ago

Browse source code at

Authors: Sebastian Funk [aut, cre] , Maria Bekker-Nielsen Dunbar [ctb] , Carl A. B. Pearson [ctb] , Sam Clifford [ctb] , Christopher Jarvis [ctb] , Alexis Robert [ctb]

Documentation:   PDF Manual  

GPL-3 license

Imports data.table, curl, httr, jsonlite, oai, wpp2015, countrycode, stringr, XML, lubridate

Suggests testthat, knitr, rmarkdown, ggplot2, reshape2, formatR

Suggested by o2geosocial.

See at CRAN