ImperialCollegeLondon / covid19model

Code for modelling estimated deaths and cases for COVID19.
MIT License
944 stars 271 forks source link

Handling dependencies, documentation, and modularity through an R package #96

Open MansMeg opened 4 years ago

MansMeg commented 4 years ago

Hi!

I realized that you in your version 3 had already factorized a lot of the code I also had refactored so submitting that would not help much. Rather I will try to adapt to your structure. The only difference is that I included my refactored R code in an R package to handle dependencies and enable simple reuse of your code. It also gives a simple way to document the functionality.

I suggest that the current functionality hence is included in a project-specific R package. The difference is very small, although it simplifies further development by others as well as it enables automated test suites for the refactored code.

In this PR I only included the functions in the utils/ folder. Locally I also have refactored functions for the plotting functions that could be included as well.

I now put myself as a package author and maintainer. I could happily put someone else. I also put the exact same LICENSE for the R package.

This PR will also solve the issue in PR #88 since dependencies will be handling by Rs package infrastructure.

MansMeg commented 4 years ago

Sorry for all commits in this PR, it was a little tricky to get the R package to build on Docker. That is now solved.