create_database.RdDownload 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() )
| indicator_table | Indicators created by |
|---|---|
| metadata_table | Meatadata tables created by |
| labelling_table | Labelling table created by |
| description_table | Description and keywords created for the indicators
by |
| db_path | A path to save the database. Defaults to |
An SQLite database with four tables: indicator, metadata, labelling and description.
# \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 foundcreate_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# }