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.

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

# \donttest{ 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")
#> Error in pivot_longer(., cols = all_of(c("LI", "AD", "SM")), names_to = "geo", values_to = "values"): could not find function "pivot_longer"
small_population_data <- get_eurostat_indicator( preselected_indicators = population_long, id = "demo_pjan")
#> Error in get_eurostat_indicator(preselected_indicators = population_long, id = "demo_pjan"): object 'population_long' not found
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"))
#> Warning: Closing open result set, pending rows
#> Warning: Closing open result set, pending rows
#> Warning: Closing open result set, pending rows
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'value' in selecting a method for function 'dbWriteTable': object 'small_population_data' not found
# }