create_database: Save Eurostat Indicators into a Database

Description Usage Arguments Value Examples

Description

Download and process Eurostat indicators, create their labelling table and descriptive metadata about the indicators. Save the two metadata tables into metadata tables, and the tidy indicators themselves into an indicator table.

Usage

1
2
3
4
5
6
7
create_database(
  indicator_table,
  metadata_table,
  labelling_table,
  description_table,
  db_path = tempdir()
)

Arguments

indicator_table

Indicators created by get_eurostat_indicator or impute_indicators.

metadata_table

Meatadata tables created by get_eurostat_indicator or update_metadata.

labelling_table

Labelling table created by get_eurostat_indicator

description_table

Description and keywords created for the indicators by add_keywords.

db_path

A path to save the database. Defaults to tempdir()

Value

An SQLite database with four tables: indicator, metadata, labelling and description.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data ( "small_population")
population_long <- small_population %>%
  pivot_wider( names_from = "geo", values_from = "values") %>%
  pivot_longer ( cols = all_of(c("LI", "AD", "SM")),
                 names_to = "geo", values_to = "values")

small_population_data <- get_eurostat_indicator(
  preselected_indicators = population_long,
  id = "demo_pjan")


create_database (indicator_table = small_population_data$indicator,
                 metadata_table = small_population_data$metadata,
                 labelling_table = small_population_data$labelling,
                 description_table = small_population_data$description,
                 db_path = file.path(tempdir(), "smallpopulation.db"))

dataobservatory-eu/indicator documentation built on Dec. 19, 2021, 8:13 p.m.