Sweave / R - Automatically create an application that contains all model summaries / graphics / data profiles from analysis

I like the idea of ​​making research available at several levels of detail, i.e. abstract for a randomly curious, full text for more interested, and finally, data and code for those who work in the same area / trying to reproduce your results. Between the actual text and the data / code level, I would like to insert another layer. Namely, I would like to create a kind of automatically created application that contains full regression output, diagnostic graphs, data profiles of exploratory graphs, etc. From the analysis, regardless of whether there were these graphs / regressions, etc. included in the final document.

One of my ideas was to write a script that will check the .Rnw file and automatically:

  • Profile of all downloadable datasets (like the Hmisc package (?))
  • Summarize all the regressions, i.e. run a resume (model) for all models.
  • Present all the graphs (regardless of whether they did it in the final version)

The idea is to make this type of restrained, push-button, and not a formal application written like the whole article. I am looking for some ideas on how to do this in R in a relatively simple way. My guess is that there is some way to go through the namespace, find out something, and then dump it into a PDF file.

Thoughts? Does something like this already exist?

+4
source share
2 answers

We did this with our recent JASA article: http://hdl.handle.net/1902.1/12174 . You should be able to "make" all the paper. One note about our playback archive: we packaged the versions of the R packages we used. It turned out that as people improve their packages, sometimes they change defaults that violate our assembly. Perhaps in the future it would be possible to distribute the entire virtual machine, including the binary code R, which will be called [remember how round (x, digits =) lost its arguments and became positional from the R version to the next round (digits = x) give meaningless results without warning?].

In any case, this is our first attempt at such a complex document. I have a smaller version here http://hdl.handle.net/1902.1/13376 that does not use make.

+1
source

John, that sounds interesting, but if you provide the data and the article is formatted in sweave, wouldn't this long log file be superfluous?

Back to your question, one package that you might want to learn is zelig , because it "automates the creation of replication data files so that you (or, if you want someone else) can replicate the results of your analyzes (therefore, satisfying replication standard). " Not what you are looking for, but the concept of replication data files may give you some other ideas. note that several logs now use replication data files.

+1
source

Source: https://habr.com/ru/post/1307302/


All Articles