Skip to content

Split add geography#37

Merged
zsofia-stefan merged 33 commits intoScotGovAnalysis:mainfrom
c-riddoch:split-add_geography
Dec 17, 2025
Merged

Split add geography#37
zsofia-stefan merged 33 commits intoScotGovAnalysis:mainfrom
c-riddoch:split-add_geography

Conversation

@c-riddoch
Copy link
Copy Markdown
Collaborator

This does what was asked by the equalities team ie splits the add_geography function so the cleaning of postcodes can happen long before the additional columns are added. By creating two new functions but calling them both inside the old function this should not be a breaking change ie no existing code using the add_geography function should break. There was a request to make the lookup files optional but the datazone_lookup is needed for the local authority names to be added. The simd_lookup has been made optional.

Commits not squashed because last time people found it useful to see them.

@ken-oneill
Copy link
Copy Markdown
Member

ken-oneill commented Dec 11, 2025

Thank you @c-riddoch. I've made the following main changes:

  1. Updated the function documentation for some functions including the two new ones
  2. Renamed one function to format_postcode to make it clear that this is to format the postcode to try to meet the standard UK postcode format, not to clean the postcode (which is beyond the scope of this R package.) This function is designed to work well with the Scottish Statistics Postcode Lookup, and it can be a useful 'helper' function for checking postcodes as part of the data validation report
  3. Updated NEWS to reflect those changes above.

I am content to keep add_geography() function to avoid breaking changes for our colleagues' publication workflows.

I am also content to set simd_lookup as NULL for both add_geography() and add_geo_columns() functions as the Scottish Index of Multiple Deprivation lookup is not always required.

I'd be grateful if you or other contributor could have a look at my changes first before approving this pull request.

Ken

Copy link
Copy Markdown
Collaborator

@zsofia-stefan zsofia-stefan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New additions to documentation (including package as well as function descriptions and news) are clear and helpful; revised version numbering made explicit. Each new function has been tested individually and they run smoothly, with helpful in-built error message to make sure formatting is carried out. Updates to corresponding test scripts are relevant and run well. No apparent typos or redundancies. Brilliant improvements across the board -- thank you.

@zsofia-stefan zsofia-stefan merged commit 3a66f06 into ScotGovAnalysis:main Dec 17, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants