---
title: "List of included countries"
author: "Hugo Gruson"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{List of included countries}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

```{r}
library(contactdata)
```

The data included in this package comes from the article

> 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 as indicated by the title, not all countries were included.

The full list is available with the `list_countries()` function:

```{r}
(all_contacts <- list_countries())
```

Below is a map that may help you find out which countries are absent from the
dataset:

```{r, fig.width=10, fig.fullwidth=TRUE, eval = requireNamespace("ggplot2", quietly = TRUE) & requireNamespace("maps", quietly = TRUE) & requireNamespace("countrycode", quietly = TRUE)}
library(ggplot2)

wlrd <- map_data("world")
wlrd$region <- countrycode::countryname(wlrd$region)

wlrd$included <- wlrd$region %in% all_contacts

ggplot(wlrd, aes(long, lat, group = group, fill = included)) +
  geom_polygon() +
  coord_equal() +
  theme_bw()
```

**Note that this package does not make any geopolitical statement and only 
provides the data as it has been published.**
