CancerRegistryOfNorway / nordcancore

Other
0 stars 0 forks source link

Allow for different last years for cancer_record_count, cancer_death_count, etc. #7

Closed WetRobot closed 3 years ago

WetRobot commented 3 years ago

Changes to nordcancore::set_global_setttings and they need to applied in the appropriate stats funs too.

HuidongTian commented 3 years ago

‘last_year’ was set to a fixed value (2018L) by the package nordcancore. When compile the package, one file called “nordcan_year.txt” contains the value of “last_year” was read into R, and save as sysdata which is the metadata of the package nordcancore.

Now, ‘last_year’ must be set manually through function: nordcancore::set_global_nordcan_settings()

The purpose of such kind of modification is to allow different countries can set a different value, instead of a fixed value for all Nordic countries.

The modification includes: Set ‘last_year’ in function nordcancore::set_global_nordcan_settings(), which will save the ‘last_year’ in “global_settings_env”, and can be fetched using nordcancore:: get_global_nordcan_settings()$last_year.

Function: “nordcan_metadata_nordcan_year” is not needed anymore, so it was dropped, together with “nordcan_year.txt” and relative lines of script “sysdata.R”.

Packages nordcanepistats and nordcanpreprocessing were also affected by replacing function nordcancore::nordcan_metadata_nordcan_year() with nordcancore:: get_global_nordcan_settings()$last_year.