Skip to content

Commit d88ad90

Browse files
authored
Merge pull request #715 from jhudsl/clif-repro-summer25
reproducibility summer 2025
2 parents 8dee49b + 06e6001 commit d88ad90

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

modules/Intro/Intro.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ knitr::include_graphics(here::here("modules", "Intro", "images", "carrie.png"))
4848
```
4949

5050

51-
## Absout Us
51+
## About Us
5252

5353
**Clif McKee (he/him)**
5454

modules/Reproducibility/Reproducibility.Rmd

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
---
2+
title: "Reproducibility"
3+
output:
4+
ioslides_presentation:
5+
css: ../../docs/styles.css
6+
widescreen: yes
7+
---
8+
19
```{r include=FALSE}
210
knitr::opts_chunk$set(echo = FALSE, message = FALSE, comment=FALSE, warning=FALSE)
311
```
@@ -13,6 +21,7 @@ library(devtools)
1321
library(remotes)
1422
install.packages("ottrpal", repos = "https://cloud.r-project.org", quiet = TRUE)
1523
library(ottrpal)
24+
library(patchwork)
1625
```
1726

1827
## What's Reproducibility
@@ -173,6 +182,28 @@ sample(10)
173182

174183
Note that these are only pseudo random and the values are created doing calculations based on the given seed. Thus the same "random" values will be reproduced by everyone using the same seed with `set.seed`.
175184

185+
## `set.seed()` visualization {.smaller}
186+
187+
```{r, echo = TRUE, fig.height=3}
188+
Aset <- data.frame(x = rnorm(100)) # no seed
189+
Bset <- data.frame(x = rnorm(100)) # no seed
190+
set.seed(111); Cset <- data.frame(x = rnorm(100)) # set seed = 111
191+
set.seed(111); Dset <- data.frame(x = rnorm(100)) # set seed = 111
192+
randomA <- ggplot(Aset) + geom_histogram(aes(x = x)) + ggtitle("no seed")
193+
randomB <- ggplot(Bset) + geom_histogram(aes(x = x)) + ggtitle("no seed")
194+
randomC <- ggplot(Cset) + geom_histogram(aes(x = x)) + ggtitle("seed = 111")
195+
randomD <- ggplot(Dset) + geom_histogram(aes(x = x)) + ggtitle("seed = 111")
196+
randomA + randomB + randomC + randomD + plot_layout(ncol = 4) # combine plots with patchwork
197+
```
198+
199+
## Very helpful for bootstrapping
200+
201+
```{r, fig.alt="Rsample", out.width = "10%", echo = FALSE, fig.align='center'}
202+
knitr::include_graphics("images/Rsample.png")
203+
```
204+
205+
https://rsample.tidymodels.org/reference/bootstraps.html
206+
176207
## R Markdown syntax
177208

178209
Before:
22.2 KB
Loading

0 commit comments

Comments
 (0)