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: | 2024-12-20 13:27:05 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 = 2000 )
mi_data( x_source, y_source = NULL, year, level, x_filters = list(), y_filters = NULL, limit = 2000 )
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:
For univariate data (when y_source
is not provided):
best_year
: the best available year, closest to the requested year.
geo
: code for the NUTS region at the requested level.
geo_name
: name of the NUTS region at the requested level.
x
: the value of the univariate variable.
For bivariate data (when y_source
is provided):
best_year
: the best available year, closest to the requested year (same for both x and y variables).
geo
: code for the NUTS region at the requested level.
geo_name
: name of the NUTS region at the requested level.
x
: the value of the x variable.
y
: the value of the y variable.
# Univariate example mi_data( x_source = "TGS00010", year = 2020, level = "2", x_filters = list(isced11 = "TOTAL", unit = "PC", age = "Y_GE15", freq = "A") ) # Bivariate example mi_data( x_source = "TGS00010", y_source = "DEMO_R_MLIFEXP", year = 2020, level = "2", x_filters = list(isced11 = "TOTAL", unit = "PC", age = "Y_GE15", freq = "A"), y_filters = list(unit = "YR", age = "Y_LT1", freq = "A") )
# Univariate example mi_data( x_source = "TGS00010", year = 2020, level = "2", x_filters = list(isced11 = "TOTAL", unit = "PC", age = "Y_GE15", freq = "A") ) # Bivariate example mi_data( x_source = "TGS00010", y_source = "DEMO_R_MLIFEXP", year = 2020, level = "2", x_filters = list(isced11 = "TOTAL", unit = "PC", age = "Y_GE15", freq = "A"), y_filters = list(unit = "YR", age = "Y_LT1", freq = "A") )
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 = 1500)
mi_source_coverage(source_name, limit = 1500)
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 = 40)
mi_source_filters(source_name, year, level, filters = list(), limit = 40)
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 = 1000)
mi_sources(level, year = NULL, limit = 1000)
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)