Course 5 - Reproducable Research - Week 2 - Notes

Greg Foletta

2019-11-22

Coding Standards in R

There a couple of basic, minimal standards to adhere to.

  1. A text format.
  2. Indent your code.
  3. Limit the width of your code.
  4. Limit the size of functions.

Markdown

Text to HTML conversion tool.

Advanced Linking:

Some Link and Another Link

then in a central spot you can put:

[1]: http://google.com "Some Link"
[2]: http://theage.com.au "Another Link"

Newlines require a double space and the end of the line.

One Line Two Lines

One Line
Two Lines

R Markdown

R code integrated with the markdown language. R code is evaluated as part of the processing of the markdown. Core tool in literate statistical programming.

  • R markdown converted to standard markdown using the knitr package.
  • Markdown can be converted to HTML using the markdown package`.
  • Create slides using the slidify package.

How To Make Work Reproducible

  • Decide to do it from the start.
  • Use version control.
  • Don’t save output - generate it.
  • Save data in non-proprietary formats.

knitr

  • R package
  • Supports RMarkdown, LaTeX, and HTML as documentation languages.
  • Can export to PDF, HTML.
  • Built right into RStudio.