Study closeout documentation

I am in the process of producing the final report for a study. The report is generated using RMarkdown, and the code itself has a lot of tidyverse stuff. (Thanks to Hadley and team for all the neat applications you have generated.)

My question is what I should produce as final documentation. Of course that documentation would include the R and Rmd source files as well as the output. Back in my SAS days I would also include the SAS log, and I am looking for a good analog in R.

For those not familiar with SAS, the log includes such items as the version number, the code, timing information for each procedure (roughly equivalent to an R function), various file sizes, and warning and error messages. Timing information in the log and output files pretty well proves that the run in the log is the run that produced the output.

Perhaps I could produce something similar by running the main file twice: once producing output that the customer wants to see, and once echoing all the code. But maybe there is a better way; hence my question.

In case it is relevant, the particular study is not in a government regulated environment. Nevertheless specific references to guidances from government agencies would be appreciated.

Bill

  1. What's a version? The code hasn't been exposed, and it seems silly to save every change, So it provides no useful information.
  2. See microbenchmark::microbenchmark for timing of runs (not between versions for the same reason).
  3. Exclude {base} warnings and errors. Provide help style documentation on function arguments.

In the spirit of reproducible research I would like a future user to be able to reproduce what I have done. Knowing the version of R and dplyr that I used could be important. I could put the version numbers in comments, but I have a strong preference for making things self-documenting. The function sessionInfo() would largely accomplish that purpose, but there might be better ways.

{usethis} provides tools for this

1 Like

For dependency tracking part of reproducibility use renv package.

2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.