```{R, eval=FALSE} while (...) { ... }
## Restarting R Restart early, restart often... and don't restore data. <center>{ width=100% }</center> ## Errors <center>{ width=100% }</center> ## Errors <center>{ width=100% }</center> ## Debugging There are lots of debugging options in R <center>{ width=100% }</center> ## `for (...)` loops - recap Doing something a fixed number of times: ```{R, comment=""} sequence <- seq(from = 0, to = 2, by = 0.5) for (number in sequence) { print(number) }
while (...)
loopsDoing something until it is finished:
{R, comment=""}
number <- 0
max.number <- 2
increment <- 0.5
while (number <= max.number) {
print(number)
number <- number + increment
}
Slide images: Jenny Bryan, https://github.com/jennybc/debugging
Death certificate (modified): Public Domain, https://commons.wikimedia.org/w/index.php?curid=214170
Autopsy painting by Rembrandt: https://www.mauritshuis.nl/en/explore/the-collection/artworks/the-anatomy-lesson-of-dr-nicolaes-tulp-146/detailgegevens/ Public Domain, https://commons.wikimedia.org/w/index.php?curid=64281722
The Night King: https://cnet4.cbsistatic.com/img/vugy5MvUVBvwcJf0JvKIBd1RwJE=/1200x675/2019/04/22/2b2fee8d-111a-4d19-ae83-4e61899cfd47/1nightking.jpg (probably copyright HBO)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.