Last active
October 20, 2020 16:46
-
-
Save lcolladotor/8a7165dbcdba06e09230daf3cb5ebabe to your computer and use it in GitHub Desktop.
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
--- | |
title: "Test seed in Rmd" | |
author: "Leonardo Collado-Torres" | |
date: "10/20/2020" | |
output: html_document | |
--- | |
_This Rmd file is in response to a question during the [R-Ladies Baltimore 2020-10-20 event](https://www.meetup.com/rladies-baltimore/events/273327907/). The code is available on this [gist](https://gist.github.com/lcolladotor/8a7165dbcdba06e09230daf3cb5ebabe) and the rendered version is available through [RPubs](https://rpubs.com/lcollado/test_seed_rmd)._ | |
Set the seed then print a set of random 10 letters. | |
```{r "set_the_seed"} | |
set.seed(20201020) | |
result <- sample(letters, size = 10) | |
result | |
``` | |
Test that it is the expected sequence of 10 letters | |
```{r "check_results"} | |
stopifnot( | |
identical( | |
result, | |
c("e", "r", "k", "d", "h", "a", "c", "i", "j", "q") | |
) | |
) | |
``` | |
## Reproducibility information | |
```{r "reproducibility_info"} | |
options(width = 120) | |
sessioninfo::session_info() | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment