From f0215486cce62dc77c9a6dd31c52753a63339387 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Sun, 4 Oct 2020 16:08:10 -0500 Subject: [PATCH] Consistent function names Fixes #790 --- iteration.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)