dataobservatory-eu / indicator Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
Add a package description with the most representative examples / links to vignettes to README file
@pitkant , can you please share the code that created the three test dbs....
I would like to see if it works now without a problem with the new metadata.
I created an s3 class for the manual creation or singular importing of indicators. The main idea is explained in the vignette, i.e. force individual dataset contributions to match the schema of the API/database; and to help such conversions.
I also slightly alterred some metadata in the Eurostat import. I think that the main task now is to agree on a final look of how an indicator should be in the database, API, because both the API and the automatic documentation will build on this -- it will be more and more difficult to make structural changes.
Current time-wise imputation is partly based on zoo, and forecast., and partly on time_tk and it ecosystem. time_tk is much better integrated with tidyverse, and its ecosystem is developing faster.
Change all zoo/forecast approximation, forecasting and backcasting to time_tk and modeltime (which is also tidymodels compatible)
Currently, test_unique_observations()
produces the following outputs:
TRUE
if there are no duplicates in the indicator tablestop_on_error = TRUE
FALSE
and a data frame if there are duplicates and stop_on_error = FALSE
I suggest that we unify these outputs, e.g.
is_unique_indicator()
that returns either TRUE
or FALSE
show_duplicated_indicators()
that returns the duplicated returns only if is_unique_indicator()
returns TRUEI'm open to other suggestions re how we can wrap it all up!
When trying to download e.g. dataset id "nama_10r_3gdp" from eurostat I get the following error:
gdp_nuts3 <- eurostat::get_eurostat(id = "nama_10r_3gdp")
gdp_nuts3_raw <- eurostat::get_eurostat(id = "nama_10r_3gdp") %>%
filter (.data$unit %in% c("EUR_HAB"))
gdp_nuts3_indicators <- get_eurostat_indicator(
preselected_indicators = gdp_nuts3_raw,
id = "nama_10r_3gdp")
Error in ncol(value_labelling) : object 'value_labelling' not found
This seems to be due to the function skipping if statement on lines 123:145 where the object value_labelling is created and moving to else-part of the if-else where
value_labels <- value_codes # this should be an empty tibble
This causes an error in lines 271:288 since the if-statement is looking for object value_labelling in
if ( ncol(value_labelling)>0 ) {
{...}
}
When trying to download dataset id "bd_hgnace2_r3" from eurostat I get the following error:
library(eurostat)
library(dplyr)
library(indicators)
business_demography <- eurostat::get_eurostat(id = "bd_hgnace2_r3")
business_demography_raw <- eurostat::get_eurostat(id = "bd_hgnace2_r3") %>%
filter (.data$indic_sb %in% c("V11920", "V11930"),
.data$nace_r2 == "B-S_X_K642",
.data$geo %in% unique(business_demography$geo[which(nchar(business_demography$geo) == 2)]))
business_demography_indicators <- get_eurostat_indicator(
preselected_indicators = business_demography_raw,
id = "bd_hgnace2_r3")
Error in is.data.frame(y) : object 'unit_labels' not found
This seems to be due to the function skipping else-part of an if-else statement on lines 177:184 where the object unit_labels is created:
if ( all(is.na(units$unit)) ) {
units$unit_label <- "[no unit]"
} else {
unit_labels <- eurostat::label_eurostat(units) %>%
mutate ( unit_label = paste0("[", .data$unit, "]")) %>%
select ( all_of("unit_label")) %>%
mutate ( unit_label = tolower(as.character(.data$unit_label))) %>%
bind_cols ( units )
}
This causes an error in lines 186:192 where the pipe is trying to perform a left_join:
indicator_ext_unit <- indicator_ext %>%
mutate ( description_indicator =
snakecase::to_sentence_case(.data$description_indicator) ) %>%
left_join ( unit_labels, by = c("unit") ) %>%
unite ( col = "description_indicator",
all_of (c("description_indicator", "unit_label")),
sep = " ",
remove = TRUE) %>%
unite ( col = "indicator_code",
all_of (c("indicator_code", "unit")),
sep = "_",
remove = FALSE) %>%
mutate ( indicator_code = snakecase::to_snake_case(.data$indicator_code))
If not there, problems would arise on lines 266:269.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.