knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of contactdata is to provide access to social contact data for 177 countries. This data comes from
Kiesha Prem, Alex R. Cook, Mark Jit, Projecting social contact matrices in 152 countries using contact surveys and demographic data, PLoS Comp. Biol. (2017), https://doi.org/10.1371/journal.pcbi.1005697.
and
Kiesha Prem, Kevin van Zandvoort, Petra Klepac, Rosalind M. Eggo, Nicholas G. Davies, CMMID COVID-19 Working Group, Alex R. Cook, Mark Jit, Projecting contact matrices in 177 geographical regions: An update and comparison with empirical data for the COVID-19 era, PLoS Comp. Biol. (2021), https://doi.org/10.1371/journal.pcbi.1009098.
(please cite them in your publications, alongside this package).
Note that this package does not make any geopolitical statement and only provides the data as it has been published.<
contactdata offers an easier access to this data, makes it readily compatible
with tidyverse packages, such as
ggplot2, via the contact_countries()
function, and provides an easy way to harmonise country nomenclature by using
the countrycode package as
authoritative name source.
You can install this package from CRAN:
install.packages("contactdata")
or the development version from GitHub, via my r-universe:
install.packages("contactdata", repos = "https://bisaloo.r-universe.dev")
The most basic function allows you to get matrix data for a specific country:
library(contactdata) contact_matrix("France")
You can also get several countries at once with the contact_df_countries()
function, as detailed in the
vignette.
Because it is very likely that users of this package will also need data about
the population in each age group, it is also bundled in this package for
convenience. Please see ?age_df_countries
for more information.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.