Mike McCann
22-23 January 2015
It's easy to generate reports dynamically in R.
Basic idea:
Write data + software + documentation (or in this case manuscripts, reports) together.
Literate programming involves three main steps:
Results from scientific research have to be reproducible to be trustworthy.
We do not want a finding to be merely due to an isolated occurrence.
This instills confidence and allows us to share data, results and scripts.
An incredibly simple semantic file format. Markdown makes it easy for even those without a web-publishing background to write any sort of text (including with links, lists, bullets, etc.) and have it displayed in a variety of formats.
In RStudio, choose new R Markdown file (easiest way)
or create a new file and save it with extension .Rmd.
# some R code
Hit the Knit HTML button
What just happened?
knitr reads the .Rmd file, finds and runs the code chunks identified by the backticks, and replaces it with the output of the functions.
Knitr will make tables, graphs, and even slides.
Documents can be hosted on RPubs.
Provides a stable URL that can be shared with others.
Everything in this course was made by typing into Rstudio.