Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 613bea4
Showing
6 changed files
with
529 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
report.html: report.Rmd code/02_render_report.R random_numbers | ||
Rscript code/02_render_report.R | ||
|
||
random_numbers: | ||
Rscript code/01_make_output.R | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f output/*.rds && rm -f report.html |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
here::i_am( | ||
"code/01_make_output.R" | ||
) | ||
|
||
set.seed(1) | ||
random_numbers1 <- rnorm(100) | ||
|
||
saveRDS( | ||
random_numbers1, | ||
file = here::here("output", "random_numbers1.rds") | ||
) | ||
|
||
set.seed(2) | ||
random_numbers2 <- rgamma(100, shape = 1) | ||
|
||
saveRDS( | ||
random_numbers2, | ||
file = here::here("output", "random_numbers2.rds") | ||
) | ||
|
||
set.seed(3) | ||
random_numbers3 <- runif(100) | ||
|
||
saveRDS( | ||
random_numbers3, | ||
file = here::here("output", "random_numbers3.rds") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
here::i_am( | ||
"code/02_render_report.R" | ||
) | ||
|
||
rmarkdown::render( | ||
here::here("report.Rmd") | ||
) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: Three sets of random numbers | ||
author: You | ||
output: html_document | ||
--- | ||
|
||
```{r, here-i-am, include = FALSE} | ||
here::i_am( | ||
"report.Rmd" | ||
) | ||
``` | ||
|
||
```{r, load-random-numbers, include = FALSE} | ||
#! TO DO: | ||
#! read random_numbers1 from output directory | ||
random_numbers1 <- readRDS( | ||
here::here("output/random_numbers1.rds") | ||
) | ||
#! TO DO: | ||
#! read random_numbers2 from output directory | ||
random_numbers2 <- readRDS( | ||
here::here("output/random_numbers2.rds") | ||
) | ||
#! TO DO: | ||
#! read random_numbers3 from output directory | ||
random_numbers3 <- readRDS( | ||
here::here("output/random_numbers3.rds") | ||
) | ||
``` | ||
|
||
# Random numbers 1 | ||
|
||
```{r, random-numbers1-histogram} | ||
#| fig.cap = "First set of random numbers" | ||
hist(random_numbers1) | ||
``` | ||
|
||
# Random numbers 2 | ||
|
||
```{r, random-numbers2-histogram} | ||
#| fig.cap = "Second set of random numbers" | ||
hist(random_numbers2) | ||
``` | ||
|
||
# Random numbers 3 | ||
|
||
```{r, random-numbers3-histogram} | ||
#| fig.cap = "Third set of random numbers" | ||
hist(random_numbers3) | ||
``` |