Additionally you want to write more modular code. There is lots of infrastructure around that in R, but people just don't use it often enough because a lot of them aren't programmers.
mlr provides very convenient infrastructure for building data mining pipelines where you can fuse steps with each other.
And you probably need to be more assertive.
https://cran.r-project.org/web/packages/assertive/index.html
https://www.youtube.com/watch?v=JWjiMvlfCwk
(and you do use testhat for unit testing, right?)
Additionally you want to write more modular code. There is lots of infrastructure around that in R, but people just don't use it often enough because a lot of them aren't programmers.
mlr provides very convenient infrastructure for building data mining pipelines where you can fuse steps with each other.
http://mlr-org.github.io/mlr-tutorial/release/html/
For non-model building activities, i.e. inference or exploratory analysis, mason is a great way to do it.
https://cran.r-project.org/web/packages/mason/vignettes/spec...