Title: | Access Mapineq Inequality Indicators via API |
---|---|
Description: | Access Mapineq inequality indicators via API. |
Authors: | Egor Kotov [aut, cre] |
Maintainer: | Egor Kotov <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9000 |
Built: | 2025-02-01 23:21:01 UTC |
Source: | https://github.com/e-kotov/mapineqr |
Fetches univariate or bivariate data for a given source, year, NUTS level, and selected filters.
mi_data( x_source, y_source = NULL, year, level, x_filters = list(), y_filters = NULL, limit = 2500 )
mi_data( x_source, y_source = NULL, year, level, x_filters = list(), y_filters = NULL, limit = 2500 )
x_source |
A |
y_source |
(Optional) A |
year |
A |
level |
A |
x_filters |
A |
y_filters |
(Optional) A |
limit |
An |
A tibble
with the following columns:
geo
: code for the (NUTS) region at the requested level.
geo_name
: name of the (NUTS) region at the requested level.
geo_source
: source (type) of the spatial units at the requested level.
geo_year
: year of the (NUTS) region at the requested level.
x_year
: The year of the predictor variable (X), included in bivariate requests.
y_year
(optional): The year of the outcome variable (Y), included in bivariate requests (only included when y_source
is provided).
x
: the value of the univariate variable.
y
(optional): the value of the y variable (only included when y_source
is provided).
# Univariate example mi_data( x_source = "TGS00010", year = 2020, level = "2", x_filters = list(isced11 = "TOTAL", sex = "F") ) # Bivariate example mi_data( x_source = "TGS00010", y_source = "DEMO_R_MLIFEXP", year = 2020, level = "2", x_filters = list(isced11 = "TOTAL", sex = "F"), y_filters = list(age = "Y2", sex = "F") )
# Univariate example mi_data( x_source = "TGS00010", year = 2020, level = "2", x_filters = list(isced11 = "TOTAL", sex = "F") ) # Bivariate example mi_data( x_source = "TGS00010", y_source = "DEMO_R_MLIFEXP", year = 2020, level = "2", x_filters = list(isced11 = "TOTAL", sex = "F"), y_filters = list(age = "Y2", sex = "F") )
Get a list of available NUTS levels
mi_nuts_levels()
mi_nuts_levels()
a character
vector of valid NUTS levels that will be accepted by other functions.
mi_nuts_levels()
mi_nuts_levels()
Get the NUTS level and Year coverage for a specific data source.
mi_source_coverage(source_name, limit = 2500)
mi_source_coverage(source_name, limit = 2500)
source_name |
name of the data source |
limit |
An |
a tibble
containing the following columns:
nuts_level
: NUTS level
year
: year
source_name
: name of the data source (mathces the source_name
requested by the user)
short_description
: short description of the data source
description
: description of the data source
mi_source_coverage("BD_HGNACE2_R3") mi_source_coverage("ghs_smod")
mi_source_coverage("BD_HGNACE2_R3") mi_source_coverage("ghs_smod")
Fetches the possible filtering values for a given source, year, and NUTS level.
mi_source_filters(source_name, year, level, filters = list(), limit = 2500)
mi_source_filters(source_name, year, level, filters = list(), limit = 2500)
source_name |
A |
year |
A |
level |
A |
filters |
A |
limit |
An |
A tibble
with the fields, labels, and their possible values for filtering.
mi_source_filters( source_name = "DEMO_R_FIND2", year = 2020, level = "2", filters = list(unit = "YR") )
mi_source_filters( source_name = "DEMO_R_FIND2", year = 2020, level = "2", filters = list(unit = "YR") )
Get a list of available data sources
mi_sources(level, year = NULL, limit = 2500)
mi_sources(level, year = NULL, limit = 2500)
level |
a |
year |
an |
limit |
An |
a tibble
of sources with the following columns:
source_name
: name of the data source
short_description
: short description of the data source
description
: description of the data source
# get up to 10 sources for NUTS level 3 mi_sources("3", limit = 10) # get all sources for NUTS level 3 and year 2020 mi_sources("3", year = 2020)
# get up to 10 sources for NUTS level 3 mi_sources("3", limit = 10) # get all sources for NUTS level 3 and year 2020 mi_sources("3", year = 2020)