choropleth_inegi: Static maps with INEGI data

View source: R/inegi.R

choropleth_inegiR Documentation

Static maps with INEGI data

Description

A state or municipio map of data available from the INEGI API

Usage

choropleth_inegi(
  token,
  regions,
  indicator,
  title,
  legend = "",
  database = "BISE",
  silent = FALSE
)

Arguments

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

Value

A choropleth

Examples

## 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
choropleth_inegi(token, state_regions, "1002000003")

## End(Not run)

diegovalle/mxmaps documentation built on Sept. 22, 2023, 9:57 p.m.