Skip to contents

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")