Reproducibility

Random seeds

To enable others to fully reproduce your results, you may need to provide a random seed. The random seed is something computers use to generate random numbers. They start from a starting seed, set with set.seed(), and every time they generate a random number they increase the seed by 1.

rnorm(5)
[1]  0.5871750 -1.1021966  1.1925684 -0.3828943 -0.1817325
rnorm(5)
[1]  1.6339536  1.0632151 -0.9837917 -0.4140305 -1.3877514
set.seed(44)
rnorm(5)
[1]  0.65391826  0.01905227 -1.84950398 -0.13276331 -1.19881818
set.seed(44)
rnorm(5)
[1]  0.65391826  0.01905227 -1.84950398 -0.13276331 -1.19881818

Many analytical methods (e.g. bootstrapping) will require random sampling. If you specify the random seed at the beginning of your document, then each time you compile it, it will produce the same results. Furthermore, if you send the RMarkdown file to someone else, they will be able to get the exact same results too!

---
title: "this is my title"
author: "I am the author"
date: "13/08/2021"
output: html_document
---

```{r setup, include = FALSE}

library(tidyverse)
library(palmerpenguins)
somedata <- read_csv("https://edin.ac/2wJgYwL")
set.seed(942) #set random seed
```

Making data and .rmd available on OSF

You may want to make your data and your RMarkdown document available on the Open Science Framework (OSF). We will not go into the details of this here, but we strongly encourage you to be transparent and provide reproducible documents where possible in your work, and OSF is a good way to do this.

You can find some FAQs about the Open Science Framework here: https://help.osf.io/hc/en-us/articles/360019737894-FAQs