Public-Health-Scotland / phsmethods

An R package to standardise methods used in Public Health Scotland (https://public-health-scotland.github.io/phsmethods/)
https://public-health-scotland.github.io/phsmethods/
54 stars 13 forks source link

Loading files where the name is subject to minor change #75

Closed RosalynLP closed 2 years ago

RosalynLP commented 2 years ago

Is your feature request related to a problem? Please describe. I've often found that in PHS we have scripts dependent on files with names that can change a little bit week on week, for example if they are put into our folders by other teams. This could be spaces changing to underscores, different capitalisation, v2 at end etc. This will then break our scripts and we have to dig around to see what the new name is and update the script week on week.

Describe the solution you'd like I made a package (https://github.com/RosalynLP/friendlyloader) which deals with this issue by searching for files with keywords matching those in the original filenames, and then appealing to the user to choose the correct option. That way the script doesn't break and need rerun, and you don't have to go and edit the script yourself every week which can be annoying if you don't have permissions.

I emailed @rmccreath to discuss the possibility of incorporating some of the functions from this package into phsmethods and he suggested to raise this issue.

Describe alternatives you've considered Could migrate the whole package to PHS ownership but then that's another package everyone would have to install, so I think it's best just to add the functions to phsmethods.

Tina815 commented 2 years ago

We agree not to include this for now considering even though it's useful, it's a bit too niche and too many needs to be migrated.