diff --git a/iteration.Rmd b/iteration.Rmd index 78438dc..36288c1 100644 --- a/iteration.Rmd +++ b/iteration.Rmd @@ -130,7 +130,7 @@ That's all there is to the for loop! Now is a good time to practice creating som x <- sample(100) sd <- 0 - for (i in seq_along(out)) { + for (i in seq_along(x)) { sd <- sd + (x[i] - mean(x)) ^ 2 } sd <- sqrt(sd) / (length(x) - 1)