Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upPkg data updates not reflected in new R sessions #11
Comments
|
Fix for this was simply to not load the pkg data within the I still have no idea how the "old" data was being loaded in the previous set up. But for now, this issue has been fixed. |
The core functions of this package require access to two reference data files - one is a df of countries and country codes, the other is a df of commodities and commodity codes. The package ships with both as package data
rdafiles ininst/extdata, but there's also a function for updating either/both of these data sets,ct_update_databases()(the API issues data updates periodically, and there are a number of different commodity data sets that the user can choose to use, and access to those is made available via theupdatefunction). The purpose of theupdatefunction is to save data updates/changes tocomtradr/extdatawithin the local R library directory (over-writing the rda file(s) in process).Something is going wrong though, currently the
updatefunction will indeed save updates down to file, however if R is restarted, the pkg data files will revert back to their state prior to updating.Here's an example:
Here I restart R.
The commodities data set that gets loaded upon package load is the data set that existed on file prior to our updating, which is not what we want.
The weird part is I can navigate to my local R packages directory, and I can see that file
commodity_table.rdawas indeed last modified during theupdatefunction. I can also manually read it in and check its type:I don't have the comtradr package installed in any old R installation directories, I removed the dev git repo (for the purpose of this test), I've searched through temp folders and don't see anything suspicious. I have no idea where the "old" data is even being loaded from.
edit to add: I've tested this on both PC and Mac.