The following shows how to return a table of the country names and 2 letter codes.
We can get this information by querying the API using dhs_countries
, and
specifying the returnFields
argument to just return the country name and
DHS country code. This is a useful reference table when you want to pass in
country IDs to a number of the API functions, e.g. dhs_data(countryIds = "BJ")
``` {r set config, message = FALSE}
library(rdhs)
ids <- dhs_countries(returnFields=c("CountryName", "DHS_CountryCode")) ids ```
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.