-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_eurostat() does not save .rds files #258
Comments
Thank you for your report, I will start looking into this. For clarification: Do you mean by being unable to access |
The triple colon operator worked. I had no idea it had existed. I thought only double colon operator works. |
@dieghernan Do you have, on the top of your head, some insight what might be the source of this caching issue here? |
Unfortunately, no. |
I ran your examples and went through the code. It would seem that there was technically no bug or unintended behaviour here, as it reads in the
This is not technically true as caching is available also from JSON IF there are filters in the query, like this:
In the
I think this could be changed in the future so that caching would be also available for queries without filters. I will mark this issue as enhancement to be taken into consideration in future version and documentation for writing more explicit documentation (or as a reminder to update the documentation if/when caching functionality is changed). |
I do not use filters, because I then receive a message that my inquiry is longer than 50 obs and I usually need many more than that. |
Judging by the history of get_eurostat.R file it would seem that the intention to prevent caching has existed at least for some years. On February this year I changed the code snippet slightly from this version
to this version
Actually now that I look at the examples above, the old code seems to imply that cache was set to FALSE when filters was not equal to "none". On the other hand cache is set to false if filters is NULL (which it rarely would be as "none" is the default parameter value), this is probably why I changed it to be more logical with the comment text as well. If you are comfortable with editing the source code of the function you could clone this repository in your RStudio and change |
This issue could be solved simultaneously with #257 by making it so that datasets that are downloaded without filters are cached whereas filtered datasets are not. |
@rideofyourlife -- thank you for your question! There is no
Here is information about starting new projects in RStudio: https://support.posit.co/hc/en-us/articles/200526207-Using-RStudio-Projects Or then you could fork this repository, make the change in your own repository and then install the modified package with devtools, with a command like this: |
Yes, sorry. I meant get_eurostat.R. |
I can't find any 'get_eurostat.R' file in "C:\Users\ropia\AppData\Local\R\win-library\4.3\eurostat", where supposedly the package is installed. What am I doing wrong? |
Right, sorry. I forgot that installed R packages only have .rdb and .rdx files in the R folder instead of function files. You could try the other alternatives I mentioned above or see what happens if you use |
I decided to go on with editing the file via edit() function. The issue I face is that I type the below in the R Studio console: I add the exclamation point in the place that you mentioned: Can you think of a reason for this? |
Did you try saving the edited function to a new temporary function like this:
I was able to save the cached file to my desired folder ("cache" folder in my home directory) after this.
EDIT: I realize I was a bit unclear in my instructions above so I'll copy-paste some relevant information from
Learn something new every day. |
Issue should be now fixed with the new version. Closed with the CRAN release of package version 4.0.0 |
Hello.
Until recently everything worked perfectly, but not so long ago the get_eurostat() function stopped saving .RDS files. This is despite the parameter cache = T and making sure the 'cache_dir' is the correct one (obviously). No file appears under the desired location. This is regardless of what directory I choose. However, when I load the dataset into a temporary variable in R memory, it works fine.
For example:
temp <- get_eurostat(id = "namq_10_gdp", cache = T, cache_dir = "XYZ")
A data.frame temp is created, but no RDS appears in the XYZ folder.
Does anyone experience the same issue?
Looking forward to your insight.
Paweł
Edit:
My R version is 4.2.3 and the installed version of the 'eurostat' package is 3.8.2
I guess it might have something to do with the fact that despite having the 3.8.2 version of the package, I don't have the access to the functions introduced in 3.7.14. It was published on 22nd of March and indeed my last RDS files are from before this date.
For example I can't access the get_eurostat_raw2 function, although theoretically I should be able to.
The text was updated successfully, but these errors were encountered: