diff --git a/iteration.Rmd b/iteration.Rmd index 815d23c..008465a 100644 --- a/iteration.Rmd +++ b/iteration.Rmd @@ -938,9 +938,9 @@ vs <- list( vs %>% reduce(intersect) ``` -The reduce function takes a "binary" function (i.e. a function with two primary inputs), and applies it repeatedly to a list until there is only a single element left. +`reduce()` takes a "binary" function (i.e. a function with two primary inputs), and applies it repeatedly to a list until there is only a single element left. -Accumulate is similar but it keeps all the interim results. You could use it to implement a cumulative sum: +`accumulate()` is similar but it keeps all the interim results. You could use it to implement a cumulative sum: ```{r} x <- sample(10)