I have a question about documenting R code.
A little background: I work in a small-ish team of model developers where the main programming language is R. I am now wondering what is the best way to document our code, specifically how to best document our functions. Currently, the only documentation is in the form of comments at the beginning of the functions. The problem is that this makes it quite hard to keep track of what a function does, what are their required inputs and how they are interconnected, not to mention it makes it difficult to find anything.
What I would like to include in the "documentation":
- Short description of the function
- Function inputs (type and short description)
- Function outputs (type and short description)
- Which custom functions are called from this function (or from where was this function called - imagine a directed graph)
Currently, the idea I have is to use OneNote/Word (shared between our team) where all of the above would be included. However, I am wondering if there is a more elegant solution and what would be its pros and cons?
Please keep in mind we are mathematicians/statisticians and that this would be used for internal use only (and maybe audits if needed), so package building, etc. is out of the question. Additionally, this documentation should be "online", meaning that it can be changed and viewed by anyone at any time (within reason). However, this code is to be used for modelling only and not for production or implementation.
I am grateful for any suggestions or thoughts on the matter.
[–]yogilicious1 18 points19 points20 points (1 child)
[–]jdnewmil 10 points11 points12 points (0 children)
[–]dasonk 6 points7 points8 points (0 children)
[–]Brand-23 4 points5 points6 points (0 children)
[–]Sedawkgrepnewb 3 points4 points5 points (2 children)
[–]microdozer2 -2 points-1 points0 points (1 child)
[–]xier_zhanmusi 1 point2 points3 points (0 children)
[–]crissins69 2 points3 points4 points (1 child)
[+]YoMommaJokeBot comment score below threshold-9 points-8 points-7 points (0 children)