| get_sidra | R Documentation |
Retrieves aggregate data from the Brazilian Institute of Geography and Statistics (IBGE) SIDRA API.
get_sidra(
x,
variable = "allxp",
period = "last",
geo = "Brazil",
geo.filter = NULL,
classific = "all",
category = "all",
header = TRUE,
format = 4,
digits = "default",
api = NULL,
value_type = c("numeric", "character", "both")
)
x |
A numeric SIDRA table code. It may be omitted when |
variable |
A vector of variable codes. Defaults to |
period |
A character vector of period codes, |
geo |
A character vector containing supported geographic levels.
Defaults to |
geo.filter |
A list of geographic filters. Each element corresponds
positionally to an element of |
classific |
A vector of classification codes. Defaults to |
category |
|
header |
Logical. Should the first API record be used as the returned column names? |
format |
An integer from 1 to 4 controlling the returned descriptor fields. See Details. |
digits |
|
api |
A relative SIDRA API path or a complete URL under
|
value_type |
How the value column is returned: |
Supported values of geo are "Brazil", "Region", "State",
"IntermediaryRegion", "ImmediateRegion", "MesoRegion",
"MicroRegion", "MetroRegion", "MetroRegionDiv", "IRD",
"UrbAglo", "PopArrang", "City", "District",
"subdistrict", and "Neighborhood".
format = 1 returns codes, format = 2 returns names, format = 3
returns codes and names for geographic units plus names for other
descriptors, and format = 4 returns codes and names for all descriptors.
Requests use HTTPS, UTF-8 decoding, a timeout, and limited retries for
transient failures. Set options(sidrar.timeout = 120) or
options(sidrar.retries = 4) to override their defaults.
The SIDRA API uses special value symbols. With the default
value_type = "numeric", non-numeric symbols such as "-", "X",
"..", and "..." become NA, as in earlier versions. Use
value_type = "character" or "both" when those distinctions matter.
A base data.frame.
Renato Prado Siqueira rpradosiqueira@gmail.com
info_sidra() and search_sidra()
## Not run:
get_sidra(
x = 7060,
variable = 63,
period = c(last = 12),
geo = "City",
geo.filter = list(State = 50),
classific = "c315",
category = list(7169)
)
get_sidra(
api = "/t/7060/n1/all/v/63/p/last/c315/7169/h/n"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.