Closed hkashiwase closed 3 years ago
Dear Haruna,
Thank you. This looks good!
I only made some minor additional updates;
fetch_indicator()
to work with the new indicators you also need to execute the data-raw/internal-variables.R
script. This will update a file called sysdata.rda
which contains a list of internal variables / vectors used by the package. (Basically in this case these variables are used to check that the user specifies a valid indicator for the chosen source). indicatorlist
of available indicators. This can be done by executing the data-raw/indicatorlist.R
script, and also updating the R/data.R
documentation file. See the changes in my commit here.
For future reference the steps I took were:
source('data-raw/internal-variables.R')
source('data-raw/indicatorlist.R')
R/data.R
file devtools::document()
Dear Aleksander,
Thank you very much for your review and comments. As for #2 in your comments, should I update data-raw/internal-variables.R only? I didn't do anything for data-raw/indicatorlist.R, but should I have done something?
May I confirm the process to add new indicators by using UNICEF's example?
By the way, I was able to download the new UNICEF indicators! I confirmed that the updated files work well!
I appreciate your advice.
Haruna
Dear Haruna,
Glad to hear that you were able to download the new indicators!
Regarding the process:
In order for fetch_indicator()
to work when adding new indicators you will need to run the script data-raw/internal-variables.R
, in addition to editing the two files R/fetch_unicef.R
and data-raw/internal-variables.R
.
The package also contains a dataset called indicatorlist
, with all the available indicators per source (take a look at data("indicatorlist")
and ?indicatorlist
). Updating this is not strictly necessary for fetch_indicator()
to work, but it is helpful to ensure that all elements of the package are in sync.
The full process then becomes something like this:
R/fetch_unicef.R
and data-raw/internal-variables.R
.data-raw/internal-variables.R
and data-raw/indicatorlist.R
R/data.R
and run devtools::document()
I already made the necessary changes for this update, but if you follow this list for future changes all aspects should be covered :)
/Aleksander
Dear Aleksander,
Thank you very much for the clarification! This is really helpful. I will follow your instruction when I need to add more indicators.
Many thanks again, Haruna
Dear Aleksander, I have added 4 new UNICEF indicators to "fetch_unicef.R" and "internal_variables.R"(Raw data).
'SP.REG.BRTH.MA.ZS','SP.REG.BRTH.FE.ZS','SP.M18.2024.FE.ZS','SP.M15.2024.FE.ZS'
Could you review the files?
Thanks, Haruna