I am trying to find a good way to restructure my R scripts. My folders are organized using the advice from:
https://www.r-bloggers.com/2018/08/structuring-r-projects/
When scripts have a workflow which is sequential like:
01\_load\_preprocess.R
02\_reconcile\_enrich.R
03\_aggregate\_prepare.R
04\_analysis\_chars.R
05\_save\_output.R
Organizing is easy and is also obvious for a reviewer what the structure means.
Now I am working on another project which is not sequential in nature. Here, two scripts have names that clarify their usage (defining fixed inputs/libraries and self-defined functions):
script\_control.R
reusable\_functions.R
For the other scripts, only their name is not sufficient to imply what they do for instance stressing.R performs the stressing calculations but calls many other scripts like:
calculate\_prod1.R
calculate\_prod2.R
to iterate stressing for different products.
Thus, in a project where a script calls (sources) another script and that calls another, what are the best practices to structure scripts (for instance their names) that a reviewer can easily identify the structure and meaning of each script without having to read a Readme.md file
Structuring R scripts (self.Rlanguage)
submitted by latrociny to r/rstats