Reproducible Research with R

Reni Kaul & Deven Gokhale & Zane Billings
2022-06-06

About Myself

  • Epi/Bios PhD student with Andreas Handel.
  • I use data analysis and statistical models to study epidemiology and immunology of flu and norovirus.
  • I started using R and R Markdown in 2017.
  • I use R in my research to:
    • organize data
    • visualize results
    • fit models
    • write reproducible manuscripts
    • pretty much everything I do is in R (Markdown), actually.
  • You can get my contact info at https://wzbillings.com. My office is on the HSC so feel free to take the bus, or just email me. I'm happy to answer any R questions. (Or questions about grad school, or anything else that might help!)

Outline

At the end of this workshop you should be able to…

  • code using best practices
  • create an HTML doc with code and commentary
  • write a function
  • create and use scripts
  • calculate summary and inferential statistics of a dataset
  • create a figure from data

Topics

  1. Introduction to reproducible research
  2. Review of tidyverse

    Break

  3. Explore data using a R project

  4. Automating data analysis with functions

  5. Using scripts in your workflow

  6. Wrap Up

THE VERY FIRST THING WE ARE GOING TO DO.

  • Open R on your computer.
  • Run install.packages("usethis") to install the usethis package.
  • Run the command usethis::use_blank_slate(). If successful, it should print a message.
  • I recommend you do this first thing every time you set up R on a new computer and every time you update R.
  • We'll talk about why I had you do this in a bit :)

1. What is Reproducible Research (RR)?

Johns Hopkins Bloomberg School of Public Health:

Reproducible Research is the idea that data analyses, and more generally, scientific claims, are published with their data and software code so that others may verify the findings and build upon them.