Reproducibility

Reproducible research is a hot topic these days, but you want nearly anything you do in R to be reproducible. Even homework. If you cannot reproduce what you did, then how can anyone — even you yourself — have any confidence that what you did is correct?

The way you make an R analysis reproducible is to

But it is much nicer to make a nice text document in some format like PDF or HTML that includes R not by cut-and-paste but rather by always recalculating from the R source whenever the document is produced.

Then the document (1) looks nice but (2) is still fully reproducible.

Now that reproducibility is such a hot topic, people are becomimg more skeptical of any document that is not reproducible. If your work isn't reproducible, it doesn't have much credibility. How can anyone trust that your computations are correct when big corporations with highly trained software engineers cannot produce bug-free code? Why are you so much better than everybody else?

Your humble instructor has made enough bugs so that he does not expect anyone to take any analysis he does on faith. Every publication he has had in the last ten years that involves computing has been backed up by one or more technical reports that have completely reproducible calculations. The main R tools for this are

Output Files

Her are some example files that illustrate R code, plots, and tables.

Source Files