Open sckott opened 8 years ago
It took me way too long to get around to this, but I'm finally starting to rebuild this as a package. However, it seemed easier to start a new repo and 'start fresh' as a package. I'm also moving from and individual based model to an age structured spatially explicit model to speed things up (to make it more usable). I'm going to keep the user_input.R
and master
while I rebuild the basic functions and then I'll make master
a giant wrapper function that uses a lot of the parameters from user_input
as arguments.
you asked on twitter how could put things into functions
The
user_input
file sets a bunch of variables to be used - these could be instead R options, e..g., a function for setting options likeset_options(time = x, replicates = 100, ...)
and set the options within that fxn - OR if each options pertains only to some code parts, then the functions created for those things could accept these options as parametersThe master file - what that file does could be a function, and instead of
source()
-ing each part, those are instead functions, e.g., replacesource("reproduct_output.R")
with a function callreproduct_output(...)
with whatever parameters it should takehaving said all this, I realize this would be a lot of work - Though you do get all the benefits of an R pkg structure, being able to easily include documentation, unit tests for your code, etc.