hexbin_inegi | R Documentation |
A state hexbin map of data available from the INEGI API
hexbin_inegi(
token,
regions,
indicator,
title,
legend = "",
database = "BISE",
silent = FALSE
)
token |
The INEGI registration token available from http://www3.inegi.org.mx/sistemas/api/denue/v1/tokenVerify.aspx |
regions |
A vector of states to zoom in on. Elements of this vector must exactly match the names of states as they appear in the "region" column of ?df_mxstates. |
indicator |
Numeric indicator from the INEGI API |
title |
An optional title for the map. |
legend |
An optional name for the legend. |
database |
The database to query. BIE (Banco de Informacion Economica) or BISE (Banco de Indicadores). Defaults to BIE. |
silent |
Wether to print a text progress bar while downloading the INEGI API data |
A choropleth
## Not run:
data(df_mxstates)
## Insert token here
## If you don't have a token you can get one from:
## http://www3.inegi.org.mx//sistemas/api/indicadores/v1/tokenVerify.aspx
token <- "INSERT_TOKEN_HERE"
state_regions <- df_mxstate$region
## You can look up the numeric indicator codes at
## https://www.inegi.org.mx/servicios/api_indicadores.html
hexbin_inegi(token, state_regions, "6200205259")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.