Open Nic-Chr opened 3 years ago
I think this type of function would be super useful and I would love to see it added to the package. However, I think it has some serious issues that I don't have an immediate solution to.
match_area
(see Public-Health-Scotland/phsmethods#71). For that function, there is some code in the package to update the data but that relies on 1) package maintainers remembering to regularly update the data and 2) users updating to the latest version to ensure they have the latest data.Some ideas I had to work around this would be:
Thanks @Moohan,
I agree that a good solution to this would be to create a separate package containing the postcode directory that could sit within phsverse.
Alternatively we could create a function within phsmethods to allow the user to download the SPD on-demand, which would then get loaded into their R environment for use for the rest of the session. This would require a dependency on an API and some code to make sure it works as expected.
I would lean towards creating a package for the directory (and maybe other common Scottish lookup files, though not sure if this already exists).
Proposing a function to convert postcodes to variables found in the Scottish postcode directory.
It could work like below: