Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplication of for loop code in multiple functions #1

Open
BarbaraRobson opened this issue Nov 19, 2022 · 0 comments
Open

Duplication of for loop code in multiple functions #1

BarbaraRobson opened this issue Nov 19, 2022 · 0 comments

Comments

@BarbaraRobson
Copy link
Collaborator

Most functions have similar code at the start to set things up (start and end dates, file names and locations) and then loop through the required time-steps and files, month by month or day by day. Each function has its main code inside these loops. We should be able to simplify this by having a function to do all the set-up and call a specified function passed in by name inside the loop. The R package, purrr should be useful here.

@BarbaraRobson BarbaraRobson changed the title Duplication of code in multiple functions Duplication of for loop code in multiple functions Nov 19, 2022
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

No branches or pull requests

1 participant