Closed pitkant closed 8 months ago
Some notes:
"{ "error": [{"status": 400,"id": 140,"label": "ERR_TIME_DIMENSION_DUPLICATED: Time dimension is duplicated. Time dimension can not be defined in more than one clause and can not be defined as TimedimensionValue and TIME_PERIOD in the same request."}]}"
and the following error message in R:
eurostat::clean_eurostat_cache()
tbl_hp <- get_eurostat("TIPSHO40", filter = list(sinceTimePeriod = 2005, untilTimePeriod = 2007))
Request failed [400]. Retrying in 1 seconds...
Request failed [400]. Retrying in 1 seconds...
Error in get_eurostat_json(id, filters, type = type, stringsAsFactors = stringsAsFactors, :
The requested url cannot be found within the get_eurostat_json function: https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/TIPSHO40?sinceTimePeriod=2005&untilTimePeriod=2007&format=JSON&lang=EN"
(Slightly unrelated note to this issue: It would be a good idea to take the error message label and print it to R users as well)
eurostat::clean_eurostat_cache()
tbl_hp <- get_eurostat("TIPSHO40", filter = list(time_period = 2005))
Error in `[.data.frame`(variables, rev(names(variables))) :
undefined columns selected
fromTimePeriod
, untilTimePeriod
and lastTimePeriod
:eurostat::clean_eurostat_cache()
tbl_hp <- get_eurostat("TIPSHO40", filter = list(sinceTimePeriod = 2005))
eurostat::clean_eurostat_cache()
tbl_hp <- get_eurostat("TIPSHO40", filter = list(untilTimePeriod = 2007))
eurostat::clean_eurostat_cache()
tbl_hp <- get_eurostat("TIPSHO40", filter = list(lastTimePeriod = 3))
This issue might actually be a problem on Eurostat's side.
I have received a reply from Eurostat User Support. Their workaround was to (in the specific case of time frame 2005-2007) retrieve each time dimension 1 by 1 with the following query:
It is unlikely we will implement this workaround to eurostat package as Eurostat developers are apparently working with the issue right now. We will continue monitoring this.
I tested the queries above and things seem to work now, somewhat.
The method as described in the documentation (using both sinceTimePeriod and untilTimePeriod in the same query) work:
get_eurostat("TIPSHO40", filter = list(sinceTimePeriod = 2005, untilTimePeriod = 2007))
Table TIPSHO40 cached at /var/folders/f4/h_r3y60n0nn0qm6qx5hnx1s00000gn/T//RtmpNkdn9b/eurostat/TIPSHO40_date_code_FF.rds
# A tibble: 972 × 5
freq unit geo time values
<chr> <chr> <chr> <date> <dbl>
1 Q INX_Q BE 2005-01-01 69.7
2 Q INX_Q BE 2005-04-01 71.2
3 Q INX_Q BE 2005-07-01 73.8
4 Q INX_Q BE 2005-10-01 75.2
5 Q INX_Q BE 2006-01-01 76.7
6 Q INX_Q BE 2006-04-01 78.8
7 Q INX_Q BE 2006-07-01 81.1
8 Q INX_Q BE 2006-10-01 81.7
9 Q INX_Q BE 2007-01-01 83.6
10 Q INX_Q BE 2007-04-01 85.3
# ℹ 962 more rows
However, the following example still doesn't work:
> eurostat::clean_eurostat_cache()
Deleted .rds/.RData files from /var/folders/f4/h_r3y60n0nn0qm6qx5hnx1s00000gn/T//RtmpNkdn9b/eurostat
> get_eurostat("TIPSHO40", filter = list(time = c(2005:2008)))
Error in `[.data.frame`(variables, rev(names(variables))) :
undefined columns selected
Eurostat user support answered me that the allowed filter = list(sinceTimePeriod = 2005, untilTimePeriod = 2007)
works now and, as already seen before, I can confirm it.
The explicitly not-accepted filtering filters = list(time = c(2005:2008)
does not work in case of TIPSHO40 dataset but it works with other datasets. Maybe this is related to TIPSHO40 being quarterly data? I asked Eurostat to clarify their documentation on this.
What should work also on quarterly data, according to Eurostat documentation, is filters = list(time = 2005)
. It does not work and I've asked Eurostat for clarification. As a workaround data for a singular year can be filtered with filters = list(sinceTimePeriod = 2005, untilTimePeriod = 2005)
or maybe with eurostat own suggestion filters = list(time = 2005-Q1, time = 2005-Q2, time = 2005-Q3, time = 2005-Q4)
(which funnily enough was supposed to be not-accepted).
If quarterly data works differently from other types of data, I will clarify this in eurostat
function documentation
Closed with the CRAN release of package version 4.0.0
The following code produces an error:
whereas this works normally:
With other datasets using
time
parameters (e.g.filter = list(time(2005:2023))
) works normally so this issue might be related to the fact that this dataset is quarterly. We will have to explore this.