Scripts and R Markdowns and Packages, Oh My!

Interacting with R

Hacking at the console

Scripts

R Markdowns & Reproducible Research

  • Donald Knuth, 1983

The key idea here is very simple; if you want to trust your results you should: - be able to document your manipulation in plain English - Recreate your entire analysis from start to finish from scratch

You’ll notice of course at this point that the course assignments app is just using R Markdown documents to compile and send me your solutions!

RStudio Projects

Packages

I’ve already installed ggplot2 for you, but if you were working on your own computer you could install it by running:

The other way to access functions in packages, which you’ve seen using the course app is with the :: operator:

Packages come with (possibly) three things:

  • New functions that you can run
  • Documentation for each function and sometimes higher level tutorials called ‘vignettes’ and ‘demos’
  • Data sets; usually the data needed to run examples

Let’s open the main help page for ggplot2: