diff --git a/iteration.Rmd b/iteration.Rmd index 305e8b2..f0cc1b8 100644 --- a/iteration.Rmd +++ b/iteration.Rmd @@ -228,7 +228,7 @@ Typically you'll be modifying a list or data frame with this sort of loop, so re There are three basic ways to loop over a vector. So far I've shown you the most general: looping over the numeric indices with `for (i in seq_along(xs))`, and extracting the value with `x[[i]]`. There are two other forms: 1. Loop over the elements: `for (x in xs)`. This is most useful if you only - care about side-effects, liking plotting or saving a file, because it's + care about side-effects, like plotting or saving a file, because it's difficult to save the output efficiently. 1. Loop over the names: `for (nm in names(xs))`. This gives you name, which