class: center, middle, inverse, title-slide # Introducing the Toolkit ### Yue Jiang ### STA 210 / Duke University / Spring 2023 --- ### Reproducibility and Replicability .vocab[Reproducibility] is being able to take the original data and code to reproduce all numerical findings - Does the code actually do what you think it does? - Is it clear *why* the code was written in this way? - Can the code be used for other data or extended to do other things? .vocab[Replicability] is being able to independently repeat an entire study without use of the original data (generally with the same methods) - End-to-end scripting of research (we'll do this with .vocab[R] and .vocab[Quarto]) - Use of version control and documentation (we'll do this with .vocab[GitHub]) - Publication of code along with data (the instructional team will check this!) --- ### Reproducibility and Replicability <img src="img/retraction.png" width="100%" style="display: block; margin: auto;" /> --- ### The toolkit! .vocab[R] is a statistical programming language; .vocab[RStudio] is a convenient interface for R (technically, an .vocab[integrated development environment], or IDE) .vocab[Quarto] allows us to create fully reproducible reports - the analysis is run from the beginning each time you render. - Code goes in "chunks" and narrative goes outside of chunks. - Quarto has a visual document editor to make the writing experience similar to a word processor, but you can directly write in the source file if you'd prefer. Every assignment in STA 210 will be written in a Quarto document - you'll have a template to start with, but the amount of scaffolding will decrease over the course of the semester. --- ### Follow along... <br> This might be painful. Luckily, some of the initial set-up steps are a one-time only deal, and by the end of the semester, the rest of the steps will seem like second nature (I promise). <br> Ready? --- ### Follow along... <br> <img src="img/invite1.png" width="80%" style="display: block; margin: auto;" /> --- ### Follow along... <br> <img src="img/invite2.png" width="80%" style="display: block; margin: auto;" /> --- ### Follow along... <img src="img/github1.png" width="100%" style="display: block; margin: auto;" /> <p style="text-align: center;"> <a href = "https://classroom.github.com/a/yccKYXuQ">https://classroom.github.com/a/yccKYXuQ</a> </p> --- ### Follow along... <img src="img/github2.png" width="80%" style="display: block; margin: auto;" /> --- ### Follow along... <img src="img/githuba.png" width="80%" style="display: block; margin: auto;" /> ```r credentials::ssh_setup_github() ``` --- ### Follow along... <img src="img/github0.png" width="80%" style="display: block; margin: auto;" /> --- ### Follow along... <img src="img/githuba.png" width="80%" style="display: block; margin: auto;" /> ```r use_git_config(user.name = "...", user.email = "...") ``` --- ### Follow along... <img src="img/github3.png" width="100%" style="display: block; margin: auto;" /> --- ### Follow along... <img src="img/github4.png" width="60%" style="display: block; margin: auto;" /> --- ### Follow along... <img src="img/github5.png" width="100%" style="display: block; margin: auto;" /> --- ### Follow along... <img src="img/github6.png" width="80%" style="display: block; margin: auto;" /> --- ### Follow along... <img src="img/github8.png" width="80%" style="display: block; margin: auto;" /> --- ### Follow along... <img src="img/github9.png" width="100%" style="display: block; margin: auto;" /> --- ### Follow along... <img src="img/github10.png" width="100%" style="display: block; margin: auto;" /> --- ### Follow along... <img src="img/github11.png" width="80%" style="display: block; margin: auto;" /> --- ### Follow along... <br> <img src="img/github12.png" width="100%" style="display: block; margin: auto;" /> --- ### Follow along... <br> <img src="img/github13.png" width="80%" style="display: block; margin: auto;" /> --- ### Follow along... <br> <img src="img/github14.png" width="80%" style="display: block; margin: auto;" /> --- ### Follow along... <img src="img/github15.png" width="100%" style="display: block; margin: auto;" /> --- ### Looking ahead <img src="img/meteora.jpg" width="90%" style="display: block; margin: auto;" />