timriffe / DemoTools

Tools for the evaluation, adjustment, and standardization of demographic data
https://timriffe.github.io/DemoTools
Other
59 stars 31 forks source link

extrap below 1955 #231

Closed IvanWilli closed 3 years ago

IvanWilli commented 3 years ago

@timriffe Just PR related to #227 :

When check I receive 'no visible global function definition for 'reshape'' and 'no visible global function definition for 'setNames''. Thought that these were base, but... tell me if I change it with some other function. I commented the test related to "basepop caps nLxDatesIn to 1955 when provided a date below that" (655 line in test-basepop) because no more useful

timriffe commented 3 years ago

I merged to my IW and had a look: stats and reshape are from stats, so these can be handled using e.g. @importFrom stats reshape I started but did not finish this. Since functions are now documented (when did this happen, haha!) we can handle all namespace issues of this kind in the headers. So requireNamespace() no longer needed. Affects fertestr too. Can you go through an clean up utils_downloads.R for these namespace thing? Also, I notice MortalityLaws lifetable being used. Any rationale for not using our own `DemoTools functions there?

IvanWilli commented 3 years ago

@timriffe OK. Cleaned up this. All cheks pass, so ready for PR. I used MortalityLaws because that was the function that was used before in downloadfunctions. There is no differencies with DemoTools one except in ages above 90, because of Kannisto smoothing by default I think. What do you suggests? I would need to modify tests if we change that. No problem for me.

IvanWilli commented 3 years ago

@timriffe changed MortalitLaws by lt_abridged function, and all tests passed. No more warn messages because of namespace issues, when check Should we close this issue?