class: center, middle, inverse, title-slide .title[ # Reproducible Research in R ] .subtitle[ ## How to do the same thing more than once ] .author[ ### Aaron Peikert, Hannes Diemerling, Maximilian S. Ernst, Andreas M. Brandmaier ] .date[ ### 2025-06-12 ] --- class: middle, center ## In a nutshell .left[ 1. aaronpeikert.github.io/repro-workshop/self-paced 2. Do the .todo[green stuff]. 3. Take your time. ] <img src="images/qr_slides.svg" width="30%" style="float:center" /> --- class: inverse, center, middle # Why should we work reproducibly? --- class: inverse, center, middle # ~~Why~~ How should we work reproducibly? --- class: center, middle # Reproducible Research # = # same data + same analysis # = # same results --- class: center, middle <img src="images/frustrating.gif" width="30%" /> .tiny[No idea how to attribute self-made memes.] --- class: center, middle <img src="images/satisfying.jpeg" width="50%" /> .tiny[No idea how to attribute self-made memes.] --- class: middle .left[ Let me present to you today: ] .center[ # Reproducible Research: The Bleeding Edge ] .right[ An action movie. ] --- ## Properties we are after: * fully automated * independent of hardware * independent of users * continually verified --- ## Problems we want to solve: 1. copy&paste mistakes 2. inconsistent versions of code or data 3. missing or incompatible software 4. complicated or ambiguous procedure for reproduction --- ## Software we will use: 1. R Markdown 2. Git 3. Docker 4. Make --- ## Services we will use: * Posit Cloud (= RStudio Cloud) * GitHub (≠ Git) * GitHub Actions (∈ GitHub) --- class: middle, center ## TL;DR: This is almost impossible. ## Don't freak out. -- Ok, maybe a bit. --- class: center, middle # Today: ### I push you to the brink of what is possible† -- † in the form of a cozy precooked meal. --- .center[ # Alone in the wild: ] -- ## 1. do the necessary, -- ## 2. than the possible, -- ## 3. and you reach the impossible. --- class: middle .center.pull-left[ # Goal for today: ### Understanding what is possible! ] -- .center.pull-left[ # Not today: ### Reaching a deep technical understanding of what is possible. ] --- class: inverse, center, middle .left[Level 1:] # The necessary --- class: middle .center[ .large[code + data] <img src="https://publicdomainvectors.org/download.php?file=CARTON01.svg" width="30%" /> ] --- ## A Note on Computing Infrastructure Usually you work on a private laptop. -- **Not today.** For ease of setup we work in the Cloud. But confusingly we than ask another cloud provider to reproduce everything again somewhere else. An incomplete list of computational infrastructures: - laptops - virtual machines - single servers - cloud computers - high performance computers --- # Posit / RStudio Cloud Access the project: https://posit.cloud/content/10490110 --- # A single script .todo[Look around, become comfortable. Then, locate the files pane.] -- .todo[Open the R folder.] .todo[Click on the file `R/prepare_games.R`] *** .optional[Take a look at `R/prepare_inflation.R` (same thing but more complicated)] --- # An incomplete list of best practices 1. list requirements early 2. use relative locations 3. document relevant information --- # A few principles of documentation .center[ document relevant information = lot of writing ?] -- ## No -- , not necessarily. -- 1. What is *standard* does not have to be documented. 2. What is *easy* needs only little documentation. 3. What is *consistent* only has to be documented once. --- class: middle, center .left[Congratulations, you have completed:] # Necessary --- class: inverse, center, middle # Expanded Goals --- class: middle .center[ .large[code + data + text + history + software + workflow] <img src="https://publicdomainvectors.org/download.php?file=CARTON01.svg" width="30%" /> ] --- .center[ # Todo list ] .pull-left[ ## Problems 1. Copy&paste mistakes 2. Inconsistent versions of code or data 3. Missing or incompatible software 4. Complicated or ambiguous procedure for reproduction ] .pull-right[ ## Solutions 1. RMarkdown 2. Git 3. Docker 4. Make ] --- background-color: #F0F8F8 .center[ <img src="https://raw.githubusercontent.com/aaronpeikert/repro-tutorial/main/images/nutshell.svg" width="90%" /> ] --- class: inverse, center, middle .left[Level 2:] # Reproducibility: Current practice --- class: center, middle .left[Tool to learn:] # RMarkdown --- class: inverse, center, middle .left[Level 3:] # Reproducibility: best practice --- class: center, middle .left[Tool to learn:] # Git/GitHub --- class: inverse, center, middle .left[Level 4:] # Reproducibility: longterm perspektive --- class: center, middle .left[Tool to learn:] # Docker --- class: inverse, center, middle .left[Level 5:] # Reproducibility: ultimate --- class: center, middle .left[Tools to learn:] # Make + GitHub Actions --- class: middle .center[ .large[code + data + text + history + software + workflow] <img src="https://publicdomainvectors.org/download.php?file=CARTON01.svg" width="30%" /> ] --- class: middle, center <https://github.com/aaronpeikert/repro-workshop/actions> --- class: middle, center <!-- --> [aaronpeikert.github.io/repro-workshop/self-paced/](https://aaronpeikert.github.io/repro-workshop/self-paced/)