Package 'tidycenso'

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-10-15 05:01:09 UTC
Source: https://github.com/rOpenSpain/tidycenso

Help Index


Get data from the 2021 Spanish census

Description

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.

Usage

get_censo(table, variables, metrics, language = "ES")

Arguments

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 c()

language

The language used in the body request (the only valid values are 'EN' or 'ES')

Value

A data.frame with the queried data

Examples

df <- get_censo("hog", c("ID_SUP_VIV", "ID_RESIDENCIA_N1"), "SHOGARES")

Available units of measurement

Description

A list of the available units of measurement in the Spanish 2021 Census API

Usage

metrics

Format

A data frame with 51 rows and 4 columns:

id_tabla

Table ID

id_unidad_de_medida

unit ID

descripcion_unidad_de_medida_es, descripcion_unidad_de_medida_en

Content description of the unit of measurement in spanish and english

Source

https://www.ine.es/censos2021/SDC21_variables_disponibles.xlsx


Available tables

Description

A list of the available tables in the Spanish 2021 Census API

Usage

tables

Format

A data frame with 7 rows and 3 columns:

id_tabla

Table ID

descripcion_tabla_es, descripcion_tabla_en

Content description of the table in spanish and english

Source

https://www.ine.es/censos2021/SDC21_tablas_disponibles.xlsx


Available variables

Description

A list of the available variables in the Spanish 2021 Census API

Usage

variables

Format

A data frame with 395 rows and 4 columns:

id_tabla

Table ID

id_variable

Variable ID

descripcion_variable_es, descripcion_variable_en

Content description of the variable in spanish and english

Source

https://www.ine.es/censos2021/SDC21_variables_disponibles.xlsx