You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
BarbaraRobson
changed the title
Duplication of code in multiple functions
Duplication of for loop code in multiple functions
Nov 19, 2022
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.
The text was updated successfully, but these errors were encountered: