Title: | Download Data From 2021 Spanish Census |
---|---|
Description: | Retrieves data from the 2021 Spanish census through the National Institute of Statistics official API. For more info on the available tables and variables visit <https://www.ine.es/dyngs/DataLab/en/manual.html?cid=1259945952385>. |
Authors: | Héctor Meleiro |
Maintainer: | Héctor Meleiro <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.0 |
Built: | 2024-11-14 04:29:47 UTC |
Source: | https://github.com/rOpenSpain/tidycenso |
get_censo
retrieves data from the 2021 Spanish census through the API of the National Institute of Statistics. For more info on the available tables and variables visit https://www.ine.es/dyngs/DataLab/en/manual.html?cid=1259945952385.
get_censo(table, variables, metrics, language = "ES")
get_censo(table, variables, metrics, language = "ES")
table |
A string of length 1 with the table name to query data from. |
variables |
A string with variable names of the queried table. If more than one, must be provided using c() (max. 4) |
metrics |
A string with the units of measurement of the queried data. If more than one, must be provided concatenated using |
language |
The language used in the body request (the only valid values are 'EN' or 'ES') |
A data.frame with the queried data
df <- get_censo("hog", c("ID_SUP_VIV", "ID_RESIDENCIA_N1"), "SHOGARES")
df <- get_censo("hog", c("ID_SUP_VIV", "ID_RESIDENCIA_N1"), "SHOGARES")
A list of the available units of measurement in the Spanish 2021 Census API
metrics
metrics
A data frame with 51 rows and 4 columns:
Table ID
unit ID
Content description of the unit of measurement in spanish and english
https://www.ine.es/censos2021/SDC21_variables_disponibles.xlsx
A list of the available tables in the Spanish 2021 Census API
tables
tables
A data frame with 7 rows and 3 columns:
Table ID
Content description of the table in spanish and english
https://www.ine.es/censos2021/SDC21_tablas_disponibles.xlsx
A list of the available variables in the Spanish 2021 Census API
variables
variables
A data frame with 395 rows and 4 columns:
Table ID
Variable ID
Content description of the variable in spanish and english
https://www.ine.es/censos2021/SDC21_variables_disponibles.xlsx