From f02e080778485071fd9924f07f6ca78bd2a8694d Mon Sep 17 00:00:00 2001 From: hadley Date: Sun, 24 Jul 2016 09:10:35 -0500 Subject: [PATCH] Correct loop initialisation Fixes #133 --- iteration.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iteration.Rmd b/iteration.Rmd index 5ce4ed0..4ee0199 100644 --- a/iteration.Rmd +++ b/iteration.Rmd @@ -327,7 +327,7 @@ Here's how we could use a while loop to find how many tries it takes to get thre ```{r} flip <- function() sample(c("T", "H"), 1) -flips <- 1 +flips <- 0 nheads <- 0 while (nheads < 3) {