Version 2026.8.21
- The package drops
magrittr. Every%>%is now the base pipe|>, andmagrittris gone fromDESCRIPTION. - The rewrite is a relocation, not an edit. Each
%>%call was transformed the way R’s parser transforms|>, and the resulting tree was required to match the tree parsed from the rewritten file. A file whose trees disagreed was left untouched and converted by hand instead.
Version 2026.8.6
Licensing
The copyright holder is now Folkehelseinstituttet. It read “Core Surveillance”, which names the package family rather than a legal entity.
DESCRIPTIONAuthors@Rnow declares that holder withrole = "cph". It declared no copyright holder at all, and neither did any other package in the fleet. Nothing inR CMD checkreports that.The copyright year is now 2026. It read 2023.
CLAUDE.mdnow carries a Licensing section, so the year gets checked rather than silently ageing.Added a get-started overview to the front of
vignette("csdata"), which pkgdown promotes to “Get started”. The page opened on## Locationand a function call, and never said what the package is for. The new front matter states the purpose and names the five functions that do most of the work. It also points on to thelocations_norwayandpopulation_norwayvignettes.-
The overview also states two limitations a user meets early, each with the output that demonstrates it:
-
nor_locations_hierarchy_from_to()returns zero rows for everyfrom/topair that names"baregion".baregion_codeandbaregion_nameareNAon all 751 rows of the bundled hierarchy table, althoughnor_locations_names()lists 159 BA-regions. - Two laboratories share the code
"lab_nor084467", the onlylocation_codethatnor_locations_names()repeats. Pass that table aslocation_referenceandlocation_code_to_granularity_geo()returns 4 elements for a 3-element input.add_granularity_geo_to_data_set()then stops with “Supplied 4 items to be assigned to 3 items of column ‘granularity_geo’”.
-
-
Brought the prose in
R/,vignettes/,README.md,index.mdandNEWS.mdto the house standard: ASD-STE100 (Simplified Technical English), adapted. Split the long sentences, removed the em dashes fromindex.md, and capitalised the RFC-2119 keywords in the coding rules ofvignette("csdata").- Sentences over 25 words, measured per authored unit, before and after:
-
R/: 8 to 0. -
vignettes/csdata.Rmd: 1 to 0. -
README.md: 1 to 0. -
NEWS.md: 10 to 0. -
index.md,vignettes/locations_norway.Rmdandvignettes/population_norway.Rmd: 0 before and after.
-
- Regenerated
man/from the edited roxygen.NAMESPACEis unchanged, and all 13 help pages remain.
- Sentences over 25 words, measured per authored unit, before and after:
No code, data, documented function behaviour or documented number changed in this version.
Version 2026.8.4
- Documentation overhaul. Each of the four documentation homes now owns its own material:
-
README.mdis the GitHub landing page: what the package is, install, one quick start, and a which-function-do-I-want table. -
index.mdis the pkgdown home body. - The vignettes carry the worked detail.
- The roxygen reference carries the per-function contract.
-
- Grew
README.mdfrom 49 to 280 words and added the routing table. No passage is shared with a vignette. - Added
@seealsoto all 13 exported objects. A vignette code chunk covers two of them:nor_locations_names()in all three articles, andnor_population_by_age_cats()inpopulation_norway. The other 11 say plainly that no vignette covers them. - Added
@familyto four groups that share a real call-site contract: location code converters, data set column adders, population data, and unicode character lists.nor_locations_*()was deliberately left ungrouped, because the three functions share only a name prefix and return disjoint columns. - The
nor_population_by_age_cats()andnor_population_by_sex_age_cats()examples run again. Version 2026.7.2 wrapped them in\dontrun{}, after a CRAN pretest NOTE on the CPU-to-elapsed ratio. Both now pindata.table::setDTthreads(1)for the duration of the example, and restore the previous setting. - Corrected documentation that did not match the code:
-
location_code_to_granularity_geo()andlocation_code_to_iso3()no longer claim to accept a plaindata.frame. Adata.framereaches the default method. There the first warns and returns one value for the whole frame. The second returns one value per column rather than per row. -
location_code_to_iso3()andadd_iso3_to_data_set()now state that they return"nor"without reading the input. Any string therefore yields"nor", andadd_iso3_to_data_set()succeeds on a table with nolocation_codecolumn. -
set_config()returns the assigned value invisibly, notNULL, wheneverborder_noris supplied. -
nor_locations_names()lists all 20 values ofgranularity_geo, not 12. It also describeslocation_name_shortas it is. That column is set on 38 of 616 rows. It carries three letters for counties, and it is absent for the Bergen, Stavanger and Trondheim city districts. -
nor_locations_redistricting()lists all 16 values ofgranularity_geo, not 14. -
nor_population_by_age_cats()explains thatsexis"total"because the function filters to the sex total, not because the dataset lacks the split. -
nor_population_by_sex_age_cats()separates the two no-breakdown cases. Svalbard and Jan Mayen keep a realtotal. The unknown-location codes areNAon all three sex rows.
-
- Documented that
nor_locations_hierarchy_from_to()returns zero rows for everyfrom/tocombination involving"baregion", because the bundled hierarchy table carries no BA-region codes. The example that demonstrated this by silently printing an empty table was replaced. - Build-ignore
pkgdown/andRplots.pdf, whichpkgdown::build_site()and plotting scripts leave behind.
Version 2026.7.27
- Fixed
add_iso3_to_data_set(). It assigned the ISO 3166-1 alpha-3 country code to thegranularity_geocolumn instead ofiso3. It therefore never created aniso3column, and it silently overwrote any existinggranularity_geo. It now assigns toiso3and leavesgranularity_geountouched. - Corrected the documented return value of
add_iso3_to_data_set(), which described the bug as intended behaviour. - Added a test suite pinning
location_code_to_granularity_geo(),location_code_to_iso3(),add_granularity_geo_to_data_set()andadd_iso3_to_data_set().
Version 2026.7.2
CRAN release: 2026-07-02
-
Breaking: dropped support for the 2020 border year. All
_b2020datasets are removed and every data-returning function now accepts onlyborder = 2024(set_config(border_nor = 2020)andborder = 2020now error). Useborder = 2024. - Population data now carries a sex dimension.
nor_population_by_age_b2024includes realmale/female/totalsplits (fetched from SSB tables 07459 and 10826 withKjonn = TRUE). Locations where Statistics Norway provides no sex breakdown (Svalbard, Jan Mayen, unknown) carrytotalwithNAmale/female. - New exported function
nor_population_by_sex_age_cats()returns population by custom age categories split by sex, withinclude_total_ageandinclude_total_sextoggles. -
nor_population_by_age_cats()is unchanged for callers: it now filters tosex == "total"internally, so its output remains identical (total only). - Note: at redistricted sub-national levels the pipeline rounds each sex independently.
male + femalemay therefore differ fromtotalby up to 3 people, in about 0.6% of historical cells. The national level is exact.
Version 2026.3.30
CRAN release: 2026-03-31
- Population data pipeline now fetches directly from SSB PxWeb API (tables 07459 and 10826) instead of manually downloaded CSV files.
- Including 2025 and 2026 population data.
- Municipality population data now uses actual historical data per municipality code instead of crude split approximations for merged municipalities.
- National population data sourced from table 07459 (1986+), replacing the defunct dataset 59322.
- Svalbard population data now fetched from SSB table 07430 (up to 2026), replacing the static Excel file.
- Removed unused Nordic country population and location Excel files.
Version 2024.4.26
CRAN release: 2024-04-26
- Fixing an error that wouldn’t allow for include_total = TRUE in nor_population_by_age_cats
- CRAN submission.
Version 2024.1.17
CRAN release: 2024-01-18
- Fixing an error in merging for 2023->2024.
- Including population for georegion.
Version 2023.6.19
- Inclusion of location_name_short in nor_locations_names for border=2020.
- CRAN submission.
Version 2023.5.22
CRAN release: 2023-05-22
- Including redistricting data for 2024
- Setting default for border_nor to 2024.
- CRAN submission.
